Return channel type in new post websocket events
Этот коммит содержится в:
@@ -698,6 +698,7 @@ func sendNotificationsAndForget(c *Context, post *model.Post, team *model.Team,
|
|||||||
|
|
||||||
message := model.NewMessage(c.Session.TeamId, post.ChannelId, post.UserId, model.ACTION_POSTED)
|
message := model.NewMessage(c.Session.TeamId, post.ChannelId, post.UserId, model.ACTION_POSTED)
|
||||||
message.Add("post", post.ToJson())
|
message.Add("post", post.ToJson())
|
||||||
|
message.Add("channel_type", channel.Type)
|
||||||
|
|
||||||
if len(post.Filenames) != 0 {
|
if len(post.Filenames) != 0 {
|
||||||
message.Add("otherFile", "true")
|
message.Add("otherFile", "true")
|
||||||
|
|||||||
@@ -176,6 +176,7 @@ function handleNewPostEvent(msg) {
|
|||||||
mentions = JSON.parse(msg.props.mentions);
|
mentions = JSON.parse(msg.props.mentions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const channelType = msgProps.channel_type;
|
||||||
const channel = ChannelStore.get(msg.channel_id);
|
const channel = ChannelStore.get(msg.channel_id);
|
||||||
const user = UserStore.getCurrentUser();
|
const user = UserStore.getCurrentUser();
|
||||||
const member = ChannelStore.getMember(msg.channel_id);
|
const member = ChannelStore.getMember(msg.channel_id);
|
||||||
@@ -187,7 +188,7 @@ function handleNewPostEvent(msg) {
|
|||||||
|
|
||||||
if (notifyLevel === 'none') {
|
if (notifyLevel === 'none') {
|
||||||
return;
|
return;
|
||||||
} else if (notifyLevel === 'mention' && mentions.indexOf(user.id) === -1 && channel.type !== 'D') {
|
} else if (notifyLevel === 'mention' && mentions.indexOf(user.id) === -1 && channelType !== Constants.DM_CHANNEL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user