mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-14 16:17:17 +03:00
Fixing len check.
This commit is contained in:
parent
cecf00874f
commit
705cc9e1be
@ -131,10 +131,10 @@ func (c *Client) handleShell(channel ssh.Channel) {
|
||||
me = " is at a loss for words."
|
||||
}
|
||||
msg := fmt.Sprintf("** %s%s", c.Name, me)
|
||||
if c.IsSilenced() {
|
||||
c.Msg <- fmt.Sprintf("-> Message rejected, silenced.")
|
||||
if c.IsSilenced() || len(msg) > 1000 {
|
||||
c.Msg <- fmt.Sprintf("-> Message rejected.")
|
||||
} else {
|
||||
c.Server.Broadcast(msg[:200], nil)
|
||||
c.Server.Broadcast(msg, nil)
|
||||
}
|
||||
case "/nick":
|
||||
if len(parts) == 2 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user