diff --git a/downstream.go b/downstream.go index 50e46f1..c37a599 100644 --- a/downstream.go +++ b/downstream.go @@ -410,6 +410,10 @@ func (dc *downstreamConn) SendMessage(msg *irc.Message) { if msg.Command == "SETNAME" && !dc.caps["setname"] { return } + if msg.Command == "AWAY" && !dc.caps["away-notify"] { + // TODO: we can send AWAY if we just sent a PRIVMSG/NOTICE to this user + return + } if msg.Command == "ACCOUNT" && !dc.caps["account-notify"] { return } diff --git a/upstream.go b/upstream.go index 4e835a8..903df8e 100644 --- a/upstream.go +++ b/upstream.go @@ -1371,22 +1371,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { Params: []string{dc.nick, dc.marshalEntity(uc.network, nick), reason}, }) }) - case "AWAY": - if msg.Prefix == nil { - return fmt.Errorf("expected a prefix") - } - - uc.forEachDownstream(func(dc *downstreamConn) { - if !dc.caps["away-notify"] { - return - } - dc.SendMessage(&irc.Message{ - Prefix: dc.marshalUserPrefix(uc.network, msg.Prefix), - Command: "AWAY", - Params: msg.Params, - }) - }) - case "ACCOUNT": + case "AWAY", "ACCOUNT": if msg.Prefix == nil { return fmt.Errorf("expected a prefix") }