From 3b86818382610f32f1006c89e98949275ee6b1fe Mon Sep 17 00:00:00 2001
From: hmhealey <harrisonmhealey@gmail.com>
Date: Mon, 2 Nov 2015 11:55:43 -0500
Subject: Hid direct message channels from search autocomplete

---
 web/react/components/search_autocomplete.jsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'web/react/components/search_autocomplete.jsx')

diff --git a/web/react/components/search_autocomplete.jsx b/web/react/components/search_autocomplete.jsx
index f7d772677..03e14ec49 100644
--- a/web/react/components/search_autocomplete.jsx
+++ b/web/react/components/search_autocomplete.jsx
@@ -142,7 +142,10 @@ export default class SearchAutocomplete extends React.Component {
             let channels = ChannelStore.getAll();
 
             if (filter) {
-                channels = channels.filter((channel) => channel.name.startsWith(filter));
+                channels = channels.filter((channel) => channel.name.startsWith(filter) && channel.type !== 'D');
+            } else {
+                // don't show direct channels
+                channels = channels.filter((channel) => channel.type !== 'D');
             }
 
             channels.sort((a, b) => a.name.localeCompare(b.name));
-- 
cgit v1.2.3-1-g7c22

