mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
When removed from a channel, user is sent back to town square and that
channel is removed from their sidebar
This commit is contained in:
@@ -710,6 +710,10 @@ func removeChannelMember(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
message := model.NewMessage(c.Session.TeamId, "", userId, model.ACTION_USER_REMOVED)
|
||||
message.Add("channel_id",id)
|
||||
PublishAndForget(message)
|
||||
|
||||
c.LogAudit("name=" + channel.Name + " user_id=" + userId)
|
||||
|
||||
result := make(map[string]string)
|
||||
|
||||
@@ -16,6 +16,7 @@ const (
|
||||
ACTION_VIEWED = "viewed"
|
||||
ACTION_NEW_USER = "new_user"
|
||||
ACTION_USER_ADDED = "user_added"
|
||||
ACTION_USER_REMOVED = "user_removed"
|
||||
)
|
||||
|
||||
type Message struct {
|
||||
|
||||
@@ -197,6 +197,14 @@ module.exports = React.createClass({
|
||||
if (UserStore.getCurrentId() === msg.user_id) {
|
||||
AsyncClient.getChannels(true);
|
||||
}
|
||||
} else if(msg.action === "user_removed") {
|
||||
if(msg.user_id === UserStore.getCurrentId()) {
|
||||
AsyncClient.getChannels(true);
|
||||
|
||||
if(msg.props.channel_id === ChannelStore.getCurrentId()) {
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
updateTitle: function() {
|
||||
|
||||
Reference in New Issue
Block a user