From 82732d5b5d6f05aafcf629f28d6c168255e165ff Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Thu, 20 Feb 2020 01:35:03 -0500 Subject: [PATCH] fix behavior of echo-message without message-tags --- irc/handlers.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/irc/handlers.go b/irc/handlers.go index 662456f4..93d567c3 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -1943,10 +1943,15 @@ func dispatchMessageToTarget(client *Client, tags map[string]string, histType hi // the originating session may get an echo message: if rb.session.capabilities.Has(caps.EchoMessage) { - if histType == history.Tagmsg && rb.session.capabilities.Has(caps.MessageTags) { + hasTagsCap := rb.session.capabilities.Has(caps.MessageTags) + if histType == history.Tagmsg && hasTagsCap { rb.AddFromClient(message.Time, message.Msgid, nickMaskString, accountName, tags, command, tnick) } else { - rb.AddSplitMessageFromClient(nickMaskString, accountName, tags, command, tnick, message) + tagsToSend := tags + if !hasTagsCap { + tagsToSend = nil + } + rb.AddSplitMessageFromClient(nickMaskString, accountName, tagsToSend, command, tnick, message) } } if histType != history.Notice && user.Away() {