summaryrefslogtreecommitdiffstats
path: root/web/react/components/mention_list.jsx
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-07-13 15:39:53 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-07-17 15:22:56 -0400
commit079538d9e7d22cd8d5f782f4f7434858bd80d914 (patch)
treee6fe87c2dd1fc4a1782a985b7a0ec961f85f3aa9 /web/react/components/mention_list.jsx
parentfb42a74613a6a5c4ebe316cf6e528d74aa74bb78 (diff)
downloadchat-079538d9e7d22cd8d5f782f4f7434858bd80d914.tar.gz
chat-079538d9e7d22cd8d5f782f4f7434858bd80d914.tar.bz2
chat-079538d9e7d22cd8d5f782f4f7434858bd80d914.zip
Use User.FirstName for notifications instead of trying to determine it from User.Nickname
Diffstat (limited to 'web/react/components/mention_list.jsx')
-rw-r--r--web/react/components/mention_list.jsx14
1 files changed, 3 insertions, 11 deletions
diff --git a/web/react/components/mention_list.jsx b/web/react/components/mention_list.jsx
index c04e28849..524f1b337 100644
--- a/web/react/components/mention_list.jsx
+++ b/web/react/components/mention_list.jsx
@@ -188,21 +188,13 @@ module.exports = React.createClass({
for (var i = 0; i < users.length && index < MAX_ITEMS_IN_LIST; i++) {
if (this.alreadyMentioned(users[i].username)) continue;
- var firstName = "", lastName = "";
- if (users[i].nickname.length > 0) {
- var splitName = users[i].nickname.split(' ');
- firstName = splitName[0].toLowerCase();
- lastName = splitName.length > 1 ? splitName[splitName.length-1].toLowerCase() : "";
- users[i].secondary_text = users[i].nickname;
- }
-
- if (firstName.lastIndexOf(mentionText,0) === 0
- || lastName.lastIndexOf(mentionText,0) === 0 || users[i].username.lastIndexOf(mentionText,0) === 0) {
+ if (users[i].first_name.lastIndexOf(mentionText,0) === 0
+ || users[i].last_name.lastIndexOf(mentionText,0) === 0 || users[i].username.lastIndexOf(mentionText,0) === 0) {
mentions[index] = (
<Mention
ref={'mention' + index}
username={users[i].username}
- secondary_text={users[i].secondary_text}
+ secondary_text={users[i].first_name + " " + users[i].last_name}
id={users[i].id}
listId={index}
isFocused={this.state.selectedMention === index ? "mentions-focus" : ""}