diff options
author | Hayden Chudy <hjc1710@gmail.com> | 2016-12-30 11:43:14 -0500 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2016-12-30 13:43:14 -0300 |
commit | 42da7aa700cb34b77134d36b5ae9e530f80502cc (patch) | |
tree | cf7273af31ee8cc66e56eac4d5bc18fe3b6f4c96 | |
parent | 7a14a05a9c1474a1e036f422c4904f83c313a763 (diff) | |
download | chat-42da7aa700cb34b77134d36b5ae9e530f80502cc.tar.gz chat-42da7aa700cb34b77134d36b5ae9e530f80502cc.tar.bz2 chat-42da7aa700cb34b77134d36b5ae9e530f80502cc.zip |
PLT-5027: Don't show own user in auto-complete list. (#4916)
-rw-r--r-- | webapp/components/suggestion/at_mention_provider.jsx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/webapp/components/suggestion/at_mention_provider.jsx b/webapp/components/suggestion/at_mention_provider.jsx index 551f3a72b..9263c6e50 100644 --- a/webapp/components/suggestion/at_mention_provider.jsx +++ b/webapp/components/suggestion/at_mention_provider.jsx @@ -5,6 +5,7 @@ import Suggestion from './suggestion.jsx'; import Provider from './provider.jsx'; import ChannelStore from 'stores/channel_store.jsx'; +import UserStore from 'stores/user_store.jsx'; import {autocompleteUsersInChannel} from 'actions/user_actions.jsx'; @@ -142,7 +143,12 @@ export default class AtMentionProvider extends Provider { }); } - const users = members.concat(specialMentions).concat(nonmembers); + let users = members.concat(specialMentions).concat(nonmembers); + const me = UserStore.getCurrentUser(); + users = users.filter((user) => { + return user.id !== me.id; + }); + const mentions = users.map((user) => '@' + user.username); AppDispatcher.handleServerAction({ |