summaryrefslogtreecommitdiffstats
path: root/api/team.go
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-09-27 11:19:50 -0300
committerChristopher Speller <crspeller@gmail.com>2016-09-27 10:19:50 -0400
commit60347559c7fb857bd5afcd93e65b6e220625da79 (patch)
treedd60ee950e12a9c64f82a1d5239d9d3327aa7ae0 /api/team.go
parentbfca752940a13c874788b0c885d36b2b263bd4fb (diff)
downloadchat-60347559c7fb857bd5afcd93e65b6e220625da79.tar.gz
chat-60347559c7fb857bd5afcd93e65b6e220625da79.tar.bz2
chat-60347559c7fb857bd5afcd93e65b6e220625da79.zip
PLT-3734 Cleaning up shouldSendEvent function (#4024)
* PLT-3734 Cleaning up shouldSendEvent function * Fix LHS unread highlight and jewel mentions
Diffstat (limited to 'api/team.go')
-rw-r--r--api/team.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/api/team.go b/api/team.go
index 0f3475098..2be7b8545 100644
--- a/api/team.go
+++ b/api/team.go
@@ -304,8 +304,8 @@ func JoinUserToTeam(team *model.Team, user *model.User) *model.AppError {
RemoveAllSessionsForUserId(user.Id)
InvalidateCacheForUser(user.Id)
- // This message goes to every channel, so the channelId is irrelevant
- go Publish(model.NewWebSocketEvent("", "", user.Id, model.WEBSOCKET_EVENT_NEW_USER))
+ // This message goes to everyone, so the teamId, channelId and userId are irrelevant
+ go Publish(model.NewWebSocketEvent(model.WEBSOCKET_EVENT_NEW_USER, "", "", "", nil))
return nil
}
@@ -357,7 +357,9 @@ func LeaveTeam(team *model.Team, user *model.User) *model.AppError {
RemoveAllSessionsForUserId(user.Id)
InvalidateCacheForUser(user.Id)
- go Publish(model.NewWebSocketEvent(team.Id, "", user.Id, model.WEBSOCKET_EVENT_LEAVE_TEAM))
+ message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_LEAVE_TEAM, team.Id, "", "", nil)
+ message.Add("user_id", user.Id)
+ go Publish(message)
return nil
}