summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/channel.go4
-rw-r--r--model/message.go1
-rw-r--r--web/react/components/sidebar.jsx8
3 files changed, 13 insertions, 0 deletions
diff --git a/api/channel.go b/api/channel.go
index 4d8dbad09..a05aa0a3c 100644
--- a/api/channel.go
+++ b/api/channel.go
@@ -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)
diff --git a/model/message.go b/model/message.go
index 52ee69e8f..ec4817b2a 100644
--- a/model/message.go
+++ b/model/message.go
@@ -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 {
diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx
index 3cf67e410..ed75e51cf 100644
--- a/web/react/components/sidebar.jsx
+++ b/web/react/components/sidebar.jsx
@@ -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() {