move error checks to the front, as it's likely to not have a source
This commit is contained in:
parent
d9ad35d42b
commit
6e1bd23a28
8
event.go
8
event.go
@ -280,6 +280,10 @@ func (e *Event) Pretty() (out string, ok bool) {
|
|||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if e.Command == ERROR {
|
||||||
|
return fmt.Sprintf("[*] an error occurred: %s", e.Trailing), true
|
||||||
|
}
|
||||||
|
|
||||||
if e.Source == nil {
|
if e.Source == nil {
|
||||||
if e.Command != PRIVMSG && e.Command != NOTICE {
|
if e.Command != PRIVMSG && e.Command != NOTICE {
|
||||||
return "", false
|
return "", false
|
||||||
@ -329,10 +333,6 @@ func (e *Event) Pretty() (out string, ok bool) {
|
|||||||
return fmt.Sprintf("[*] %s (%s) has left %s (%s)", e.Source.Name, e.Source.Host, e.Params[0], e.Trailing), true
|
return fmt.Sprintf("[*] %s (%s) has left %s (%s)", e.Source.Name, e.Source.Host, e.Params[0], e.Trailing), true
|
||||||
}
|
}
|
||||||
|
|
||||||
if e.Command == ERROR {
|
|
||||||
return fmt.Sprintf("[*] an error occurred: %s", e.Trailing), true
|
|
||||||
}
|
|
||||||
|
|
||||||
if e.Command == QUIT {
|
if e.Command == QUIT {
|
||||||
return fmt.Sprintf("[*] %s has quit (%s)", e.Source.Name, e.Trailing), true
|
return fmt.Sprintf("[*] %s has quit (%s)", e.Source.Name, e.Trailing), true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user