mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-07-23 22:15:09 +02:00
Block the broadcast of an empty message
This commit is contained in:
parent
857dcd0a14
commit
25dc161348
@ -229,7 +229,7 @@ func (c *Client) handleShell(channel ssh.Channel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
msg := fmt.Sprintf("%s: %s", c.ColoredName(), line)
|
msg := fmt.Sprintf("%s: %s", c.ColoredName(), line)
|
||||||
if c.IsSilenced() || len(msg) > 1000 {
|
if c.IsSilenced() || len(msg) > 1000 || len(line) < 1 {
|
||||||
c.Msg <- fmt.Sprintf("-> Message rejected.")
|
c.Msg <- fmt.Sprintf("-> Message rejected.")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user