diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-05-14 18:55:56 +0200 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-05-14 18:55:56 +0200 |
commit | ab8be5010909d634093122e7e2a21d6c5857d5c8 (patch) | |
tree | 7db138438e40823c78ada44d87ff218fb039e7d2 /chat.go | |
parent | 1da36d94a00cbf7959d76797dc2c8356c36f9053 (diff) |
Improve PR
Diffstat (limited to 'chat.go')
-rw-r--r-- | chat.go | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -13,15 +13,17 @@ import ( // about a chat command that's taking long to execute. var ChatCmdTimeout = 10 * time.Second -// DoChatMsg does a chat message +// DoChatMsg handles a chat message string +// as if it was sent by the ClientConn. func (cc *ClientConn) DoChatMsg(msg string) { cmd := &mt.ToSrvChatMsg{Msg: msg} - str, fwd := onChatMsg(cc, cmd) - if len(str) != 0 { - cc.SendChatMsg(str) + result, isCmd := onChatMsg(cc, cmd) + if result != "" { + cc.SendChatMsg(result) } - if fwd { + + if !isCmd { cc.server().SendCmd(cmd) } } |