[polari] Fix updating Nick
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] Fix updating Nick
- Date: Thu, 8 Aug 2013 13:09:47 +0000 (UTC)
commit c9addc93c878f5ca984a2c8b8eb262cd6653f977
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Jul 25 15:31:09 2013 +0200
Fix updating Nick
Apparently the self-contact prop on connection provides what we need ...
src/mainWindow.js | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index b65db4f..15ce3a2 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -223,26 +223,29 @@ const MainWindow = new Lang.Class({
},
_updateAccount: function() {
- if (this._account)
- this._account.disconnect(this._nicknameChangedId);
+ if (this._conn)
+ this._conn.disconnect(this._nicknameChangedId);
this._nicknameChangedId = 0;
- if (this._room && this._room.channel)
+ if (this._room && this._room.channel) {
+ this._conn = this._room.channel.connection;
this._account = this._room.channel.connection.get_account();
- else
+ } else {
this._account = null;
+ this._conn = null;
+ }
- if (this._account)
+ if (this._conn)
this._nicknameChangedId =
- this._account.connect('notify::normalized-name',
- Lang.bind(this, this._updateNick));
+ this._conn.connect('notify::self-contact',
+ Lang.bind(this, this._updateNick));
this._updateNick();
this._updateSensitivity();
},
_updateNick: function() {
- let nick = this._account ? this._account.normalized_name : '';
+ let nick = this._conn ? this._conn.self_contact.alias : '';
this._nickEntry.placeholder_text = nick;
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]