Fix dm tab being opened on server messages

This commit is contained in:
Ken-Håvard Lieng 2020-05-21 05:24:26 +02:00
parent 1abe280957
commit 35727fb2b8
3 changed files with 46 additions and 35 deletions

View file

@ -75,6 +75,10 @@ func (c *Client) GetNick() string {
return nick
}
func (c *Client) Is(nick string) bool {
return c.EqualFold(nick, c.GetNick())
}
func (c *Client) setNick(nick string) {
c.lock.Lock()
c.nick = nick

View file

@ -19,6 +19,10 @@ func (m *Message) LastParam() string {
return ""
}
func (m *Message) IsFromServer() bool {
return m.Nick == "" || strings.Contains(m.Nick, ".")
}
func (m *Message) ToCTCP() *CTCP {
return DecodeCTCP(m.LastParam())
}