* Add command and store changes to allow mute toggling * Change channel muting to use ChannelMember notification structure * Suppress email and push notifications for a muted channel * Make i18n keys issue-compliant * Add notification-cache handling for channel-muting * Add channel handle for channel-muting slash-command * Add unit test for mute command * Merge branch 'master' into PLT-4340 # Conflicts: # app/notification.go * Fix issue that command_mute responses will be overwritten * Fix i18n key for channel muting * Apply new Provider Interface to MuteCommand * Migrate mute notification property to mark_unread PLT-4340 * Make some i18n improvements for command_mute PLT-4340 * Remove de.json translations * Prevent push notifications when channel is muted * Treat Group messages like Direct messages * Fix unit test * Send WS event when the channel member notify props changed
Этот коммит содержится в:
коммит произвёл
Elias Nahum
родитель
71c9dff766
Коммит
257f748732
@@ -482,6 +482,10 @@ func (a *App) UpdateChannelMemberNotifyProps(data map[string]string, channelId s
|
||||
} else {
|
||||
a.InvalidateCacheForUser(userId)
|
||||
a.InvalidateCacheForChannelMembersNotifyProps(channelId)
|
||||
// Notify the clients that the member notify props changed
|
||||
evt := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_MEMBER_UPDATED, "", "", userId, nil)
|
||||
evt.Add("channelMember", member.ToJson())
|
||||
a.Publish(evt)
|
||||
return member, nil
|
||||
}
|
||||
}
|
||||
@@ -1481,3 +1485,16 @@ func (a *App) GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.
|
||||
}
|
||||
return result.Data.(*model.Channel), nil
|
||||
}
|
||||
|
||||
func (a *App) ToggleMuteChannel(channelId string, userId string) *model.ChannelMember {
|
||||
member := (<-a.Srv.Store.Channel().GetMember(channelId, userId)).Data.(*model.ChannelMember)
|
||||
|
||||
if member.NotifyProps[model.MARK_UNREAD_NOTIFY_PROP] == model.CHANNEL_NOTIFY_MENTION {
|
||||
member.NotifyProps[model.MARK_UNREAD_NOTIFY_PROP] = model.CHANNEL_MARK_UNREAD_ALL
|
||||
} else {
|
||||
member.NotifyProps[model.MARK_UNREAD_NOTIFY_PROP] = model.CHANNEL_NOTIFY_MENTION
|
||||
}
|
||||
|
||||
a.Srv.Store.Channel().UpdateMember(member)
|
||||
return member
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user