mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-06-07 02:43:05 +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."
|
me = " is at a loss for words."
|
||||||
}
|
}
|
||||||
msg := fmt.Sprintf("** %s%s", c.Name, me)
|
msg := fmt.Sprintf("** %s%s", c.Name, me)
|
||||||
if c.IsSilenced() {
|
if c.IsSilenced() || len(msg) > 1000 {
|
||||||
c.Msg <- fmt.Sprintf("-> Message rejected, silenced.")
|
c.Msg <- fmt.Sprintf("-> Message rejected.")
|
||||||
} else {
|
} else {
|
||||||
c.Server.Broadcast(msg[:200], nil)
|
c.Server.Broadcast(msg, nil)
|
||||||
}
|
}
|
||||||
case "/nick":
|
case "/nick":
|
||||||
if len(parts) == 2 {
|
if len(parts) == 2 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user