mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fix posts from your own webhook not showing as unread until refresh (#5703)
This commit is contained in:
committed by
George Goldberg
parent
9c13863f48
commit
270ac11365
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,10 @@ export function isSystemMessage(post) {
|
||||
return post.type && (post.type.lastIndexOf(Constants.SYSTEM_MESSAGE_PREFIX) === 0);
|
||||
}
|
||||
|
||||
export function isFromWebhook(post) {
|
||||
return post.props && post.props.from_webhook === 'true';
|
||||
}
|
||||
|
||||
export function isPostOwner(post) {
|
||||
return UserStore.getCurrentId() === post.user_id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user