Prevent some zero length stuff
Don't send zero length messages to the server, and ignore the /me command without any arguments.
This commit is contained in:
parent
c0d3731b84
commit
8e39585968
|
@ -26,7 +26,9 @@ var commands = &CommandControl{
|
|||
common.CNMe.String(): Command{
|
||||
HelpText: "Display an action message.",
|
||||
Function: func(client *Client, args []string) string {
|
||||
client.Me(strings.Join(args, " "))
|
||||
if len(args) != 0 {
|
||||
client.Me(strings.Join(args, " "))
|
||||
}
|
||||
return ""
|
||||
},
|
||||
},
|
||||
|
|
|
@ -224,6 +224,10 @@ func recieve(v []js.Value) {
|
|||
}
|
||||
|
||||
func websocketSend(msg string, dataType common.ClientDataType) error {
|
||||
if strings.TrimSpace(msg) == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
data, err := json.Marshal(common.ClientData{
|
||||
Type: dataType,
|
||||
Message: msg,
|
||||
|
|
Loading…
Reference in New Issue