Этот коммит содержится в:
Chris
2018-03-02 10:49:18 -06:00
коммит произвёл Joram Wilander
родитель 2b3b6051d2
Коммит 4ebf974690
12 изменённых файлов: 23 добавлений и 70 удалений

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

@@ -221,9 +221,7 @@ 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)
a.Go(func() {
a.Publish(event)
})
a.Publish(event)
}
func (a *App) SetStatusOffline(userId string, manual bool) {
@@ -247,9 +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)
a.Go(func() {
a.Publish(event)
})
a.Publish(event)
}
func (a *App) SetStatusAwayIfNeeded(userId string, manual bool) {
@@ -290,9 +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)
a.Go(func() {
a.Publish(event)
})
a.Publish(event)
}
func (a *App) SetStatusDoNotDisturb(userId string) {
@@ -318,9 +312,7 @@ func (a *App) SetStatusDoNotDisturb(userId string) {
event := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_STATUS_CHANGE, "", "", status.UserId, nil)
event.Add("status", model.STATUS_DND)
event.Add("user_id", status.UserId)
a.Go(func() {
a.Publish(event)
})
a.Publish(event)
}
func GetStatusFromCache(userId string) *model.Status {