remove remaining Global() calls (outside of tests) (#7521)
Этот коммит содержится в:
коммит произвёл
Saturnino Abril
родитель
1bd66589a2
Коммит
8c80cdde38
@@ -213,15 +213,15 @@ func (a *App) SetStatusOnline(userId string, sessionId string, manual bool) {
|
||||
}
|
||||
|
||||
if broadcast {
|
||||
BroadcastStatus(status)
|
||||
a.BroadcastStatus(status)
|
||||
}
|
||||
}
|
||||
|
||||
func BroadcastStatus(status *model.Status) {
|
||||
func (a *App) BroadcastStatus(status *model.Status) {
|
||||
event := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_STATUS_CHANGE, "", "", status.UserId, nil)
|
||||
event.Add("status", status.Status)
|
||||
event.Add("user_id", status.UserId)
|
||||
go Publish(event)
|
||||
go a.Publish(event)
|
||||
}
|
||||
|
||||
func (a *App) SetStatusOffline(userId string, manual bool) {
|
||||
@@ -245,7 +245,7 @@ func (a *App) SetStatusOffline(userId string, manual bool) {
|
||||
event := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_STATUS_CHANGE, "", "", status.UserId, nil)
|
||||
event.Add("status", model.STATUS_OFFLINE)
|
||||
event.Add("user_id", status.UserId)
|
||||
go Publish(event)
|
||||
go a.Publish(event)
|
||||
}
|
||||
|
||||
func (a *App) SetStatusAwayIfNeeded(userId string, manual bool) {
|
||||
@@ -286,7 +286,7 @@ func (a *App) SetStatusAwayIfNeeded(userId string, manual bool) {
|
||||
event := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_STATUS_CHANGE, "", "", status.UserId, nil)
|
||||
event.Add("status", model.STATUS_AWAY)
|
||||
event.Add("user_id", status.UserId)
|
||||
go Publish(event)
|
||||
go a.Publish(event)
|
||||
}
|
||||
|
||||
func GetStatusFromCache(userId string) *model.Status {
|
||||
|
||||
Ссылка в новой задаче
Block a user