From fec10f5f80a554eece55a17c479b04bb42d2dea0 Mon Sep 17 00:00:00 2001
From: Girish S <girish.sonawane@gmail.com>
Date: Fri, 30 Oct 2015 12:44:00 +0530
Subject: Show usernames overridden by Incoming Webhooks in notification
 messages. fixes PLT-856

---
 web/react/stores/socket_store.jsx | 4 +++-
 1 file changed, 3 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 4d69a6716..1cdd390db 100644
--- a/web/react/stores/socket_store.jsx
+++ b/web/react/stores/socket_store.jsx
@@ -189,7 +189,9 @@ function handleNewPostEvent(msg) {
         }
 
         let username = 'Someone';
-        if (UserStore.hasProfile(msg.user_id)) {
+        if (post.props.override_username && global.window.mm_config.EnablePostUsernameOverride === 'true') {
+            username = post.props.override_username;
+        } else if (UserStore.hasProfile(msg.user_id)) {
             username = UserStore.getProfile(msg.user_id).username;
         }
 
-- 
cgit v1.2.3-1-g7c22

