[polari/wip/fmuellner/combined-gsoc: 58/137] removed the _user property from the UserPopover



commit 7269b613737ce0e927891526b564e0a1c84dff02
Author: raresv <rares visalom gmail com>
Date:   Sat Jul 9 00:19:43 2016 +0300

    removed the _user property from the UserPopover

 src/userList.js |   22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)
---
diff --git a/src/userList.js b/src/userList.js
index 12d20df..40009e9 100644
--- a/src/userList.js
+++ b/src/userList.js
@@ -364,16 +364,6 @@ const UserPopover = new Lang.Class({
         this._vbox.show_all();
     },
 
-    set user(user) {
-        this._user = user;
-
-        this._updateContents();
-    },
-
-    get user() {
-        return this._user;
-    },
-
     set nickname(nickname) {
         this._nickname = nickname;
 
@@ -381,8 +371,6 @@ const UserPopover = new Lang.Class({
 
         this._userTracker.connect("status-changed::" + baseNick, Lang.bind(this, this._onNickStatusChanged));
 
-        this.user = this._userTracker.getBestMatchingContact(this._nickname);
-
         this._updateContents();
     },
 
@@ -391,11 +379,13 @@ const UserPopover = new Lang.Class({
     },
 
     _updateContents: function() {
+        let bestMatchingContact = this._userTracker.getBestMatchingContact(this._nickname);
+
         this._nickLabel.set_label(this._nickname);
-        this._statusLabel.set_label(this._user ? "Online" : "Offline");
+        this._statusLabel.set_label(bestMatchingContact ? "Online" : "Offline");
 
-        if (this._user) {
-            this._userDetails.user = this._user;
+        if (bestMatchingContact) {
+            this._userDetails.user = bestMatchingContact;
 
             let context = this._statusLabel.get_style_context();
             context.set_state(Gtk.StateFlags.LINK);
@@ -451,7 +441,7 @@ const UserPopover = new Lang.Class({
             }
     },
 
-    _onNickStatusChanged: function(tracker, nickName, status) { log("da");
+    _onNickStatusChanged: function(tracker, nickName, status) {
         this.user = this._userTracker.getBestMatchingContact(this._nickname);
     }
 });


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