Fixing websocket and team store issues when leaving team (#4412)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
60a43a5b4f
Коммит
b0f38f8a84
10
api/team.go
10
api/team.go
@@ -347,6 +347,12 @@ func LeaveTeam(team *model.Team, user *model.User) *model.AppError {
|
||||
}
|
||||
}
|
||||
|
||||
// Send the websocket message before we actually do the remove so the user being removed gets it.
|
||||
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_LEAVE_TEAM, team.Id, "", "", nil)
|
||||
message.Add("user_id", user.Id)
|
||||
message.Add("team_id", team.Id)
|
||||
Publish(message)
|
||||
|
||||
teamMember.Roles = ""
|
||||
teamMember.DeleteAt = model.GetMillis()
|
||||
|
||||
@@ -361,10 +367,6 @@ func LeaveTeam(team *model.Team, user *model.User) *model.AppError {
|
||||
RemoveAllSessionsForUserId(user.Id)
|
||||
InvalidateCacheForUser(user.Id)
|
||||
|
||||
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_LEAVE_TEAM, team.Id, "", "", nil)
|
||||
message.Add("user_id", user.Id)
|
||||
go Publish(message)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user