summaryrefslogtreecommitdiffstats
path: root/app/status.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2018-03-02 10:49:18 -0600
committerJoram Wilander <jwawilander@gmail.com>2018-03-02 16:49:18 +0000
commit4ebf9746905c845ee3874f87478d7450391680d8 (patch)
tree03163cd0809b2ae8c11e774ea5fbec2dff9d4e59 /app/status.go
parent2b3b6051d265edf131d006b2eb14f55284faf1e5 (diff)
downloadchat-4ebf9746905c845ee3874f87478d7450391680d8.tar.gz
chat-4ebf9746905c845ee3874f87478d7450391680d8.tar.bz2
chat-4ebf9746905c845ee3874f87478d7450391680d8.zip
remove `go Publish(...)` idiom (#8373)
Diffstat (limited to 'app/status.go')
-rw-r--r--app/status.go16
1 files changed, 4 insertions, 12 deletions
diff --git a/app/status.go b/app/status.go
index 1ef7aef0f..d677f9a23 100644
--- a/app/status.go
+++ b/app/status.go
@@ -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 {