summaryrefslogtreecommitdiffstats
path: root/app/channel.go
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2018-05-28 22:31:08 +0800
committerGitHub <noreply@github.com>2018-05-28 22:31:08 +0800
commitc37d153ffb276e501660133de836a61eec25e544 (patch)
tree6c45576f1df735922aecd5d7e29458f945e46dba /app/channel.go
parentc3e9c414408a8c9c2806af12e659e395c605496f (diff)
downloadchat-c37d153ffb276e501660133de836a61eec25e544.tar.gz
chat-c37d153ffb276e501660133de836a61eec25e544.tar.bz2
chat-c37d153ffb276e501660133de836a61eec25e544.zip
[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>
Diffstat (limited to 'app/channel.go')
-rw-r--r--app/channel.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/channel.go b/app/channel.go
index 26e3d771c..b5afdea2d 100644
--- a/app/channel.go
+++ b/app/channel.go
@@ -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
}
}