From 270ac113654d17cabf4a92d48de4ca4a9de65c46 Mon Sep 17 00:00:00 2001
From: Joram Wilander <jwawilander@gmail.com>
Date: Thu, 9 Mar 2017 14:41:23 -0500
Subject: Fix posts from your own webhook not showing as unread until refresh
 (#5703)

---
 webapp/stores/channel_store.jsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'webapp/stores/channel_store.jsx')

diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx
index f303b0190..41fa76b39 100644
--- a/webapp/stores/channel_store.jsx
+++ b/webapp/stores/channel_store.jsx
@@ -10,7 +10,7 @@ import UserStore from 'stores/user_store.jsx';
 var ChannelUtils;
 var Utils;
 import {ActionTypes, Constants} from 'utils/constants.jsx';
-import {isSystemMessage} from 'utils/post_utils.jsx';
+import {isSystemMessage, isFromWebhook} from 'utils/post_utils.jsx';
 const NotificationPrefs = Constants.NotificationPrefs;
 
 const CHANGE_EVENT = 'change';
@@ -521,7 +521,7 @@ ChannelStore.dispatchToken = AppDispatcher.register((payload) => {
             return;
         }
 
-        if (action.post.user_id === UserStore.getCurrentId() && !isSystemMessage(action.post)) {
+        if (action.post.user_id === UserStore.getCurrentId() && !isSystemMessage(action.post) && !isFromWebhook(action.post)) {
             return;
         }
 
-- 
cgit v1.2.3-1-g7c22

