[polari] telepathyClient: Use GNetworkMonitor::network-changed signal



commit 4e6929e3d0824e96fa23cc826861e86d9cfd118f
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Jun 21 13:42:52 2017 +0200

    telepathyClient: Use GNetworkMonitor::network-changed signal
    
    Unlike notify::network-available that is emitted when the availability
    of a default route changes, ::network-changed is emitted on any network
    changes, for example when previously unavailable ranges become available
    after connecting to a VPN network. As this may well be the reason for a
    previous connection failure, it makes sense for us to reconnect accounts
    in response.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784047

 src/telepathyClient.js |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/telepathyClient.js b/src/telepathyClient.js
index 33f8a0f..cc59263 100644
--- a/src/telepathyClient.js
+++ b/src/telepathyClient.js
@@ -197,13 +197,13 @@ const TelepathyClient = new Lang.Class({
             this._onAccountStatusChanged(this._accountsMonitor, a);
         });
 
-        this._networkMonitor.connect('notify::network-available',
-                                     Lang.bind(this, this._onNetworkAvailableChanged));
-        this._onNetworkAvailableChanged();
+        this._networkMonitor.connect('network-changed',
+                                     Lang.bind(this, this._onNetworkChanged));
+        this._onNetworkChanged(this._networkMonitor,
+                               this._networkMonitor.network_available);
     },
 
-    _onNetworkAvailableChanged: function() {
-        let connected = this._networkMonitor.network_available;
+    _onNetworkChanged: function(mon, connected) {
         let presence = connected ? Tp.ConnectionPresenceType.AVAILABLE
                                  : Tp.ConnectionPresenceType.OFFLINE;
         debug('Network changed to %s'.format(connected ? 'available'


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