[polari/wip/bastianilso/error-handling: 16/19] app: Always save channels requested by the user
- From: Bastian Ilsø Hougaard <bastianilso src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/bastianilso/error-handling: 16/19] app: Always save channels requested by the user
- Date: Thu, 13 Aug 2015 17:18:58 +0000 (UTC)
commit 516ccd61c7c98b1ab60652a1e2dc4873e790f54a
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 be96bf4..b7ab206 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 we receive a disconnect error and the network is unavailable,
@@ -336,6 +333,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]