mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
client: Ignore empty lines, send ERROR with no prefix
This commit is contained in:
parent
52127edde3
commit
67d65b0e3d
@ -170,7 +170,9 @@ func (client *Client) run() {
|
|||||||
maxlenTags, maxlenRest := client.maxlens()
|
maxlenTags, maxlenRest := client.maxlens()
|
||||||
|
|
||||||
msg, err = ircmsg.ParseLineMaxLen(line, maxlenTags, maxlenRest)
|
msg, err = ircmsg.ParseLineMaxLen(line, maxlenTags, maxlenRest)
|
||||||
if err != nil {
|
if err == ircmsg.ErrorLineIsEmpty {
|
||||||
|
continue
|
||||||
|
} else if err != nil {
|
||||||
client.Quit("received malformed line")
|
client.Quit("received malformed line")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -429,7 +431,7 @@ func (client *Client) ChangeNickname(nickname string) error {
|
|||||||
func (client *Client) Quit(message string) {
|
func (client *Client) Quit(message string) {
|
||||||
if !client.quitMessageSent {
|
if !client.quitMessageSent {
|
||||||
client.Send(nil, client.nickMaskString, "QUIT", message)
|
client.Send(nil, client.nickMaskString, "QUIT", message)
|
||||||
client.Send(nil, client.nickMaskString, "ERROR", message)
|
client.Send(nil, "", "ERROR", message)
|
||||||
client.quitMessageSent = true
|
client.quitMessageSent = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user