[polari] app: Don't restore saved channels of disabled accounts



commit 52dfb70a9899729aeab8f5c72f3a044c4fd05bb5
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Sep 28 22:56:12 2013 +0200

    app: Don't restore saved channels of disabled accounts
    
    Trying to ensure a channel for a disabled account is guaranteed to
    fail, so don't even try. Instead, restore the channels when the
    account becomes available.

 src/application.js     |    3 +++
 src/chatroomManager.js |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 5f7e51f..24a3a75 100644
--- a/src/application.js
+++ b/src/application.js
@@ -266,6 +266,9 @@ const Application = new Lang.Class({
         let factory = Tp.AccountManager.dup().get_factory();
         let account = factory.ensure_account(accountPath, []);
 
+        if (!account.enabled)
+            return;
+
         let requestData = {
           account: account,
           targetHandleType: targetType,
diff --git a/src/chatroomManager.js b/src/chatroomManager.js
index cc331ad..2c645f8 100644
--- a/src/chatroomManager.js
+++ b/src/chatroomManager.js
@@ -83,6 +83,8 @@ const _ChatroomManager = new Lang.Class({
         this._handler.register();
         this._observer.register();
 
+        am.connect('account-enabled',
+                   Lang.bind(this, this._restoreSavedChannels));
         this._restoreSavedChannels();
     },
 


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