From 6cba0353c936fbb2cac8b32b893def75c28ae81e Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Thu, 28 Jan 2016 12:28:02 -0500
Subject: Return channel type in new post websocket events

---
 web/react/stores/socket_store.jsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'web/react/stores/socket_store.jsx')

diff --git a/web/react/stores/socket_store.jsx b/web/react/stores/socket_store.jsx
index f1fade305..736b0ca27 100644
--- a/web/react/stores/socket_store.jsx
+++ b/web/react/stores/socket_store.jsx
@@ -176,6 +176,7 @@ function handleNewPostEvent(msg) {
             mentions = JSON.parse(msg.props.mentions);
         }
 
+        const channelType = msgProps.channel_type;
         const channel = ChannelStore.get(msg.channel_id);
         const user = UserStore.getCurrentUser();
         const member = ChannelStore.getMember(msg.channel_id);
@@ -187,7 +188,7 @@ function handleNewPostEvent(msg) {
 
         if (notifyLevel === 'none') {
             return;
-        } else if (notifyLevel === 'mention' && mentions.indexOf(user.id) === -1 && channel.type !== 'D') {
+        } else if (notifyLevel === 'mention' && mentions.indexOf(user.id) === -1 && channelType !== Constants.DM_CHANNEL) {
             return;
         }
 
-- 
cgit v1.2.3-1-g7c22

