Don't send TAGMSG to upstreams that don't support it

TAGMSG are (in current specs and drafts from IRCv3) only used for
client tags. These are optional information by design (since they are
not distributed to all users), therefore it is preferable to discard
them accordingly to upstream, instead of waiting for all upstreams to
support the capability to advertise it.
This commit is contained in:
Hubert Hirtz 2020-11-20 11:19:51 +01:00 committed by Simon Ser
parent 88d241fd1d
commit e4d2ddb377
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -1553,6 +1553,9 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
if err != nil {
return err
}
if _, ok := uc.caps["message-tags"]; !ok {
continue
}
uc.SendMessageLabeled(dc.id, &irc.Message{
Tags: tags,