PLT-3734 Cleaning up shouldSendEvent function (#4024)

* PLT-3734 Cleaning up shouldSendEvent function

* Fix LHS unread highlight and jewel mentions
Этот коммит содержится в:
enahum
2016-09-27 11:19:50 -03:00
коммит произвёл Christopher Speller
родитель bfca752940
Коммит 60347559c7
17 изменённых файлов: 117 добавлений и 110 удалений

Просмотреть файл

@@ -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
}