aboutsummaryrefslogtreecommitdiff
path: root/chat.go
diff options
context:
space:
mode:
Diffstat (limited to 'chat.go')
-rw-r--r--chat.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/chat.go b/chat.go
index 2a8cda4..0578cb2 100644
--- a/chat.go
+++ b/chat.go
@@ -81,5 +81,13 @@ func onChatMsg(cc *ClientConn, cmd *mt.ToSrvChatMsg) (string, bool) {
return cmd.Handler(cc, args...), true
}
- return "", false
+ onChatMsgMu.RLock()
+ defer onChatMsgMu.RUnlock()
+
+ msg := cmd.Msg
+ for _, handler := range onChatMsgs {
+ msg = handler(cc, msg)
+ }
+
+ return msg, msg == ""
}