From 1c7f0be268046d2b509e23268eebcbbef78c5a24 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Thu, 9 Jul 2015 15:49:23 -0400 Subject: Renamed all clientside references from full_name to nickname --- web/react/stores/user_store.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/react/stores/user_store.jsx') diff --git a/web/react/stores/user_store.jsx b/web/react/stores/user_store.jsx index dd207ca80..c293469e5 100644 --- a/web/react/stores/user_store.jsx +++ b/web/react/stores/user_store.jsx @@ -180,8 +180,8 @@ var UserStore = assign({}, EventEmitter.prototype, { 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 (user.nickname.length > 0 && user.notify_props.first_name === "true") { + var first = user.nickname.split(' ')[0]; if (first.length > 0) keys.push(first); } -- cgit v1.2.3-1-g7c22 From 079538d9e7d22cd8d5f782f4f7434858bd80d914 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Mon, 13 Jul 2015 15:39:53 -0400 Subject: Use User.FirstName for notifications instead of trying to determine it from User.Nickname --- web/react/stores/user_store.jsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'web/react/stores/user_store.jsx') diff --git a/web/react/stores/user_store.jsx b/web/react/stores/user_store.jsx index c293469e5..e417e72ff 100644 --- a/web/react/stores/user_store.jsx +++ b/web/react/stores/user_store.jsx @@ -180,11 +180,7 @@ var UserStore = assign({}, EventEmitter.prototype, { if (user && user.notify_props && user.notify_props.mention_keys) { var keys = user.notify_props.mention_keys.split(','); - if (user.nickname.length > 0 && user.notify_props.first_name === "true") { - var first = user.nickname.split(' ')[0]; - if (first.length > 0) keys.push(first); - } - + 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'); -- cgit v1.2.3-1-g7c22 From e737ec3eb5d16a8ea371c0bd9379d8d0a937764c Mon Sep 17 00:00:00 2001 From: hmhealey Date: Mon, 13 Jul 2015 15:43:05 -0400 Subject: Allow Users to be notified using @all, @channel, and their first name when other notifications are disabled --- web/react/stores/user_store.jsx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'web/react/stores/user_store.jsx') 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", ''); -- cgit v1.2.3-1-g7c22