[PLT-4340] Channel Mute and "/mute" command #7617 (#7713)

* 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
Этот коммит содержится в:
Christian Claus
2018-03-28 06:02:04 +02:00
коммит произвёл Elias Nahum
родитель 71c9dff766
Коммит 257f748732
7 изменённых файлов: 316 добавлений и 37 удалений

Просмотреть файл

@@ -783,6 +783,14 @@ func TestDoesNotifyPropsAllowPushNotification(t *testing.T) {
if DoesNotifyPropsAllowPushNotification(user, channelNotifyProps, post, true) {
t.Fatal("Should have returned false")
}
// WHEN default is ALL and channel is MUTED
userNotifyProps[model.PUSH_NOTIFY_PROP] = model.USER_NOTIFY_ALL
user.NotifyProps = userNotifyProps
channelNotifyProps[model.MARK_UNREAD_NOTIFY_PROP] = model.CHANNEL_MARK_UNREAD_MENTION
if DoesNotifyPropsAllowPushNotification(user, channelNotifyProps, post, false) {
t.Fatal("Should have returned false")
}
}
func TestDoesStatusAllowPushNotification(t *testing.T) {