From 60347559c7fb857bd5afcd93e65b6e220625da79 Mon Sep 17 00:00:00 2001 From: enahum Date: Tue, 27 Sep 2016 11:19:50 -0300 Subject: PLT-3734 Cleaning up shouldSendEvent function (#4024) * PLT-3734 Cleaning up shouldSendEvent function * Fix LHS unread highlight and jewel mentions --- api/team.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'api/team.go') 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 } -- cgit v1.2.3-1-g7c22