Skip to content

Commit

Permalink
Merge 6bc037f into 71e6a42
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyhulen committed Mar 1, 2017
2 parents 71e6a42 + 6bc037f commit 650b84a
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions app/web_hub.go
Expand Up @@ -90,14 +90,6 @@ func HubUnregister(webConn *WebConn) {

func Publish(message *model.WebSocketEvent) {

if SkipTypingMessage(message) {
if metrics := einterfaces.GetMetricsInterface(); metrics != nil {
metrics.IncrementWebsocketEvent(message.Event + "_skipped")
}

return
}

if metrics := einterfaces.GetMetricsInterface(); metrics != nil {
metrics.IncrementWebsocketEvent(message.Event)
}
Expand Down Expand Up @@ -337,14 +329,3 @@ func (h *Hub) Start() {

go doRecoverableStart()
}

func SkipTypingMessage(msg *model.WebSocketEvent) bool {
// Only broadcast typing messages if less than 1K people in channel
if msg.Event == model.WEBSOCKET_EVENT_TYPING {
if Srv.Store.Channel().GetMemberCountFromCache(msg.Broadcast.ChannelId) > *utils.Cfg.TeamSettings.MaxNotificationsPerChannel {
return true
}
}

return false
}

0 comments on commit 650b84a

Please sign in to comment.