Fix echo-message for TAGMSG

A previous fix (d4b7bb02da) only fixed sending echo-message for
TAGMSG to self. We also need to send echo-message for TAGMSG to
other targets.

Closes: https://todo.sr.ht/~emersion/soju/111
This commit is contained in:
delthas 2022-02-09 16:50:24 +01:00 committed by Simon Ser
parent b1a83529e1
commit 17cd3b3e98

View file

@ -2434,6 +2434,19 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc.
Params: []string{upstreamName},
})
echoTags := tags.Copy()
echoTags["time"] = irc.TagValue(time.Now().UTC().Format(serverTimeLayout))
if uc.account != "" {
echoTags["account"] = irc.TagValue(uc.account)
}
echoMsg := &irc.Message{
Tags: echoTags,
Prefix: &irc.Prefix{Name: uc.nick},
Command: "TAGMSG",
Params: []string{upstreamName},
}
uc.produce(upstreamName, echoMsg, dc)
uc.updateChannelAutoDetach(upstreamName)
}
case "INVITE":