summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2016-01-28 12:28:02 -0500
committerJoramWilander <jwawilander@gmail.com>2016-01-28 12:28:02 -0500
commit6cba0353c936fbb2cac8b32b893def75c28ae81e (patch)
treeffff3c69b3dae0fba96cd4e4739352fc87441199
parentdb37897538f134b29784453797510c20e1e9303c (diff)
downloadchat-6cba0353c936fbb2cac8b32b893def75c28ae81e.tar.gz
chat-6cba0353c936fbb2cac8b32b893def75c28ae81e.tar.bz2
chat-6cba0353c936fbb2cac8b32b893def75c28ae81e.zip
Return channel type in new post websocket events
-rw-r--r--api/post.go1
-rw-r--r--web/react/stores/socket_store.jsx3
2 files changed, 3 insertions, 1 deletions
diff --git a/api/post.go b/api/post.go
index d3807653d..e8345b5e5 100644
--- a/api/post.go
+++ b/api/post.go
@@ -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.Add("post", post.ToJson())
+ message.Add("channel_type", channel.Type)
if len(post.Filenames) != 0 {
message.Add("otherFile", "true")
diff --git a/web/react/stores/socket_store.jsx b/web/react/stores/socket_store.jsx
index f1fade305..736b0ca27 100644
--- a/web/react/stores/socket_store.jsx
+++ b/web/react/stores/socket_store.jsx
@@ -176,6 +176,7 @@ function handleNewPostEvent(msg) {
mentions = JSON.parse(msg.props.mentions);
}
+ const channelType = msgProps.channel_type;
const channel = ChannelStore.get(msg.channel_id);
const user = UserStore.getCurrentUser();
const member = ChannelStore.getMember(msg.channel_id);
@@ -187,7 +188,7 @@ function handleNewPostEvent(msg) {
if (notifyLevel === 'none') {
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;
}