[polari] app: Always save channels requested by the user



commit da5f75c0082b5c89788322580aa0c7223bb0992e
Author: Bastian Ilsø <bastianilso gnome org>
Date:   Wed Aug 12 16:40:23 2015 +0200

    app: Always save channels requested by the user
    
    When the user joins a room it makes sense to
    also join it next time polari is started, even
    if the room was never successfully connected to.

 src/application.js |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 7262bfd..626cc02 100644
--- a/src/application.js
+++ b/src/application.js
@@ -302,9 +302,6 @@ const Application = new Lang.Class({
 
         try {
             req.ensure_channel_finish(res);
-
-            if (requestData.targetHandleType == Tp.HandleType.ROOM)
-                this._addSavedChannel(account, requestData.targetId);
         } catch (e if e.matches(Tp.Error, Tp.Error.DISCONNECTED)) {
             let error = account.connection_error;
             if (error == ConnectionError.ALREADY_CONNECTED &&
@@ -330,6 +327,10 @@ const Application = new Lang.Class({
         let [accountPath, channelName, time] = parameter.deep_unpack();
         this._requestChannel(accountPath, Tp.HandleType.ROOM,
                              channelName, time);
+
+        let factory = Tp.AccountManager.dup().get_factory();
+        let account = factory.ensure_account(accountPath, []);
+        this._addSavedChannel(account, channelName);
     },
 
     _onMessageUser: function(action, parameter) {


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