From 250a344d04d8e682a98760bdc378d1a5c46f31e6 Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Fri, 7 Jul 2017 20:23:58 -0400
Subject: PLT-7039 Use loadProfilesAndStatusesForPosts from the redux library
 (#6881)

---
 webapp/actions/websocket_actions.jsx | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

(limited to 'webapp/actions/websocket_actions.jsx')

diff --git a/webapp/actions/websocket_actions.jsx b/webapp/actions/websocket_actions.jsx
index dec3edd12..82c9df617 100644
--- a/webapp/actions/websocket_actions.jsx
+++ b/webapp/actions/websocket_actions.jsx
@@ -15,7 +15,7 @@ import WebSocketClient from 'client/web_websocket_client.jsx';
 import * as WebrtcActions from './webrtc_actions.jsx';
 
 import * as GlobalActions from 'actions/global_actions.jsx';
-import {handleNewPost, loadProfilesForPosts} from 'actions/post_actions.jsx';
+import {handleNewPost} from 'actions/post_actions.jsx';
 import {loadProfilesForSidebar} from 'actions/user_actions.jsx';
 import {loadChannelsForCurrentUser} from 'actions/channel_actions.jsx';
 import * as StatusActions from 'actions/status_actions.jsx';
@@ -34,7 +34,7 @@ import {getSiteURL} from 'utils/url.jsx';
 
 import * as TeamActions from 'mattermost-redux/actions/teams';
 import {viewChannel, getChannelAndMyMember, getChannelStats} from 'mattermost-redux/actions/channels';
-import {getPosts} from 'mattermost-redux/actions/posts';
+import {getPosts, getProfilesAndStatusesForPosts} from 'mattermost-redux/actions/posts';
 import {setServerVersion} from 'mattermost-redux/actions/general';
 import {ChannelTypes, TeamTypes, UserTypes, PostTypes, EmojiTypes} from 'mattermost-redux/action_types';
 
@@ -242,9 +242,7 @@ function handleNewPostEvent(msg) {
     const post = JSON.parse(msg.data.post);
     handleNewPost(post, msg);
 
-    const posts = {};
-    posts[post.id] = post;
-    loadProfilesForPosts(posts);
+    getProfilesAndStatusesForPosts([post], dispatch, getState);
 
     if (post.user_id !== UserStore.getCurrentId()) {
         UserStore.setStatus(post.user_id, UserStatuses.ONLINE);
-- 
cgit v1.2.3-1-g7c22

