[polari/wip/fmuellner/combined-gsoc: 93/137] userTracker: Be a bit more concise



commit f6ebc01d24e55a3741af40c2636f8a7c66935177
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Jul 19 21:05:45 2016 +0200

    userTracker: Be a bit more concise
    
    Variables don't exist in a vacuum, we have context - if a method is
    called getNotifyActionName(), it's clear enough that 'name' and 'action'
    don't refer to a frobnicate action ...

 src/userTracker.js |   21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)
---
diff --git a/src/userTracker.js b/src/userTracker.js
index 67295da..6f29cd5 100644
--- a/src/userTracker.js
+++ b/src/userTracker.js
@@ -328,19 +328,14 @@ const UserTracker = new Lang.Class({
     },
 
     getNotifyActionName: function(nickName) {
-        let notifyActionName = 'notify-user-' + this._account.get_path_suffix() + '-' + 
Polari.util_get_basenick(nickName);
-
-        let isUserGloballyOnline = this.getNickStatus(nickName) == Tp.ConnectionPresenceType.AVAILABLE;
-
-        if (!this._app.lookup_action(notifyActionName)) {
-            let newNotifyActionProps = {
-                name: notifyActionName,
-                state: GLib.Variant.new('b', false)
-            };
-
-            let newNotifyAction = new Gio.SimpleAction(newNotifyActionProps);
-
-            this._app.add_action(newNotifyAction);
+        let name = 'notify-user-' +
+                   this._account.get_path_suffix() + '-' +
+                   Polari.util_get_basenick(nickName);
+
+        if (!this._app.lookup_action(name)) {
+            let state = new GLib.Variant('b', false);
+            let action = new Gio.SimpleAction({ name: name, state: state });
+            this._app.add_action(action);
         }
 
         return notifyActionName;


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