From 17cd3b3e98f9e7bdbe01fdeacf14206b555fe5a2 Mon Sep 17 00:00:00 2001 From: delthas Date: Wed, 9 Feb 2022 16:50:24 +0100 Subject: [PATCH] Fix echo-message for TAGMSG A previous fix (d4b7bb02da1c) 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 --- downstream.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/downstream.go b/downstream.go index a52b1ad..b5caa8c 100644 --- a/downstream.go +++ b/downstream.go @@ -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":