Fix GMs showing up on refresh after being hidden (#5702)

This commit is contained in:
Joram Wilander
2017-03-09 14:41:03 -05:00
committed by George Goldberg
parent 6ff46f3050
commit 9c13863f48
3 changed files with 6 additions and 2 deletions

View File

@@ -286,7 +286,7 @@ func SendNotifications(post *model.Post, team *model.Team, channel *model.Channe
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_POSTED, "", post.ChannelId, "", nil)
message.Add("post", post.ToJson())
message.Add("channel_type", channel.Type)
message.Add("channel_display_name", channel.DisplayName)
message.Add("channel_display_name", channelName)
message.Add("channel_name", channel.Name)
message.Add("sender_name", senderUsername)
message.Add("team_id", team.Id)

View File

@@ -304,7 +304,7 @@ export function loadProfilesForGM() {
if (!isVisible) {
const member = ChannelStore.getMyMember(channel.id);
if (!member || (member.mention_count === 0 && member.msg_count < member.total_msg_count)) {
if (!member || (member.mention_count === 0 && member.msg_count >= channel.total_msg_count)) {
continue;
}

View File

@@ -82,6 +82,10 @@ class NotificationStoreClass extends EventEmitter {
title = channel.display_name;
}
if (title === '') {
title = msgProps.channel_display_name;
}
let notifyText = post.message.replace(/\n+/g, ' ');
if (notifyText.length > 50) {
notifyText = notifyText.substring(0, 49) + '...';