[polari] app: Don't try to connect while offline



commit 8d171a52855d5e10ba412b8c61c9cbec766f50ae
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Aug 16 22:39:37 2015 +0200

    app: Don't try to connect while offline
    
    It's obvious that a connection attempt will fail if we don't have
    network, so don't bother trying ...

 src/application.js |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 626cc02..f273278 100644
--- a/src/application.js
+++ b/src/application.js
@@ -41,6 +41,7 @@ const Application = new Lang.Class({
 
         this._chatroomManager = ChatroomManager.getDefault();
         this._accountsMonitor = AccountsMonitor.getDefault();
+        this._networkMonitor = Gio.NetworkMonitor.get_default();
 
         this._accountsMonitor.connect('account-removed', Lang.bind(this,
             function(am, account) {
@@ -255,6 +256,9 @@ const Application = new Lang.Class({
             return;
         }
 
+        if (!this._networkMonitor.network_available)
+            return;
+
         let roomId = Polari.create_room_id(account,  targetId, targetType);
 
         let requestData = {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]