From 42da7aa700cb34b77134d36b5ae9e530f80502cc Mon Sep 17 00:00:00 2001
From: Hayden Chudy <hjc1710@gmail.com>
Date: Fri, 30 Dec 2016 11:43:14 -0500
Subject: PLT-5027: Don't show own user in auto-complete list. (#4916)

---
 webapp/components/suggestion/at_mention_provider.jsx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'webapp/components/suggestion/at_mention_provider.jsx')

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({
-- 
cgit v1.2.3-1-g7c22

