summaryrefslogtreecommitdiffstats
path: root/web/react/stores/user_store.jsx
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-07-13 15:43:05 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-07-17 15:22:56 -0400
commite737ec3eb5d16a8ea371c0bd9379d8d0a937764c (patch)
treeb0aeb92fcb9ab093088d3a6bccf127377c2328a0 /web/react/stores/user_store.jsx
parent079538d9e7d22cd8d5f782f4f7434858bd80d914 (diff)
downloadchat-e737ec3eb5d16a8ea371c0bd9379d8d0a937764c.tar.gz
chat-e737ec3eb5d16a8ea371c0bd9379d8d0a937764c.tar.bz2
chat-e737ec3eb5d16a8ea371c0bd9379d8d0a937764c.zip
Allow Users to be notified using @all, @channel, and their first name when other notifications are disabled
Diffstat (limited to 'web/react/stores/user_store.jsx')
-rw-r--r--web/react/stores/user_store.jsx16
1 files changed, 7 insertions, 9 deletions
diff --git a/web/react/stores/user_store.jsx b/web/react/stores/user_store.jsx
index e417e72ff..b0ea719d4 100644
--- a/web/react/stores/user_store.jsx
+++ b/web/react/stores/user_store.jsx
@@ -177,17 +177,15 @@ var UserStore = assign({}, EventEmitter.prototype, {
},
getCurrentMentionKeys: function() {
var user = this.getCurrentUser();
- if (user && user.notify_props && user.notify_props.mention_keys) {
- var keys = user.notify_props.mention_keys.split(',');
- if (user.first_name && user.notify_props.first_name === "true") keys.push(user.first_name);
- if (user.notify_props.all === "true") keys.push('@all');
- if (user.notify_props.channel === "true") keys.push('@channel');
+ var keys = [];
- return keys;
- } else {
- return [];
- }
+ if (user.notify_props && user.notify_props.mention_keys) keys = keys.concat(user.notify_props.mention_keys.split(','));
+ if (user.first_name && user.notify_props.first_name === "true") keys.push(user.first_name);
+ if (user.notify_props.all === "true") keys.push('@all');
+ if (user.notify_props.channel === "true") keys.push('@channel');
+
+ return keys;
},
getLastVersion: function() {
return BrowserStore.getItem("last_version", '');