diff options
author | Corey Hulen <corey@hulen.com> | 2015-07-17 14:01:01 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-07-17 14:01:01 -0800 |
commit | b306ec84378b36372b5465c09233094314789bf2 (patch) | |
tree | 1995d12ac34a4c6ba459884c84cb28b62d62b296 /web/react/stores | |
parent | 66c22d342fa42068382c9e80427ea953676357db (diff) | |
parent | 1dba330146a10718a2fc9eac0ae7d6e1d6bc0d79 (diff) | |
download | chat-b306ec84378b36372b5465c09233094314789bf2.tar.gz chat-b306ec84378b36372b5465c09233094314789bf2.tar.bz2 chat-b306ec84378b36372b5465c09233094314789bf2.zip |
Merge pull request #177 from hmhealey/mm825
MM-825 Replace FullName field with separate FirstName and LastName fields and repurpose the existing FullName as Nickname
Diffstat (limited to 'web/react/stores')
-rw-r--r-- | web/react/stores/user_store.jsx | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/web/react/stores/user_store.jsx b/web/react/stores/user_store.jsx index dd207ca80..b0ea719d4 100644 --- a/web/react/stores/user_store.jsx +++ b/web/react/stores/user_store.jsx @@ -177,21 +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.full_name.length > 0 && user.notify_props.first_name === "true") { - var first = user.full_name.split(' ')[0]; - if (first.length > 0) keys.push(first); - } + var keys = []; - if (user.notify_props.all === "true") keys.push('@all'); - if (user.notify_props.channel === "true") keys.push('@channel'); + 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; - } else { - return []; - } + return keys; }, getLastVersion: function() { return BrowserStore.getItem("last_version", ''); |