[MM-10519] Send websocket event whenever the channel has changed it's type (public|private) (#8798)

* send websocket event whenever the channel has changed it's type (public|private)

* updated per comment

Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>

* add channel_converted websocket event

Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>

* only send channel_id via websocket message for "channel_converted" event

Signed-off-by: Saturnino Abril <saturnino.abril@gmail.com>
Этот коммит содержится в:
Saturnino Abril
2018-05-28 22:31:08 +08:00
коммит произвёл GitHub
родитель c3e9c41440
Коммит c37d153ffb
3 изменённых файлов: 39 добавлений и 1 удалений

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

@@ -366,6 +366,12 @@ func (a *App) UpdateChannelPrivacy(oldChannel *model.Channel, user *model.User)
return channel, err
}
a.InvalidateCacheForChannel(channel)
messageWs := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_CHANNEL_CONVERTED, channel.TeamId, "", "", nil)
messageWs.Add("channel_id", channel.Id)
a.Publish(messageWs)
return channel, nil
}
}