From 6611229cd7bd3cdfc0082c0a581145aaac0ab322 Mon Sep 17 00:00:00 2001
From: Corey Hulen <corey@hulen.com>
Date: Wed, 4 May 2016 06:31:42 -0700
Subject: PLT-2707 Adding option to show DM list from all of server (#2871)

* PLT-2707 Adding option to show DM list from all of server

* Fixing loc
---
 webapp/utils/utils.jsx | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'webapp/utils/utils.jsx')

diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx
index 8917c97e4..e34fa403f 100644
--- a/webapp/utils/utils.jsx
+++ b/webapp/utils/utils.jsx
@@ -1247,6 +1247,13 @@ export function openDirectChannelToUser(user, successCb, errorCb) {
         'true'
     );
 
+    // if the user in another team and isn't already in the direct message
+    // list then we should add him so his name shows up correctly.
+    var profileUser = UserStore.getProfile(user.id);
+    if (!profileUser) {
+        UserStore.getDirectProfiles()[user.id] = user;
+    }
+
     const channelName = this.getDirectChannelName(UserStore.getCurrentId(), user.id);
     let channel = ChannelStore.getByName(channelName);
 
-- 
cgit v1.2.3-1-g7c22

