diff --git a/service/actions/websocket.js b/service/actions/websocket.js index 01951a9f0..c017220c3 100644 --- a/service/actions/websocket.js +++ b/service/actions/websocket.js @@ -31,6 +31,7 @@ import { } from 'service/constants'; import {getCurrentChannelStats} from 'service/selectors/entities/channels'; import {getUserIdFromChannelName} from 'service/utils/channel_utils'; +import {isSystemMessage} from 'service/utils/post_utils'; import EventEmitter from 'service/utils/event_emitter'; export function init(siteUrl, token, optionalWebSocket) { @@ -217,8 +218,8 @@ async function handleNewPostEvent(msg, dispatch, getState) { } ]), getState); - if (userId === users.currentId || post.channel_id === currentChannelId) { - markChannelAsRead(post.channel_id); + if (userId === users.currentId || post.channel_id === currentChannelId || isSystemMessage(post)) { + markChannelAsRead(post.channel_id)(dispatch, getState); } else { markChannelAsUnread(post.channel_id, msg.data.mentions)(dispatch, getState); }