3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-26 12:42:50 +01:00

fix incorrect TAGMSG relaying

This commit is contained in:
Shivaram Lingamneni 2020-11-30 16:43:36 -05:00
parent db100f1f91
commit 1b91360885

View File

@ -172,16 +172,20 @@ func (m *MessageCache) InitializeSplitMessage(server *Server, nickmask, accountN
func (m *MessageCache) Send(session *Session) {
if m.fullTags != nil {
// Initialize() path:
if session.capabilities.Has(caps.MessageTags) {
session.sendBytes(m.fullTags, false)
} else if !(session.capabilities.Has(caps.ServerTime) || session.capabilities.Has(caps.AccountTag)) {
if m.plain != nil {
} else if m.plain != nil {
// plain == nil indicates a TAGMSG
if !(session.capabilities.Has(caps.ServerTime) || session.capabilities.Has(caps.AccountTag)) {
session.sendBytes(m.plain, false)
} else {
// slowpath
session.sendFromClientInternal(false, m.time, m.msgid, m.source, m.accountName, nil, m.command, m.params...)
}
} else {
session.sendFromClientInternal(false, m.time, m.msgid, m.source, m.accountName, nil, m.command, m.params...)
}
} else if m.fullTagsMultiline != nil {
// InitializeSplitMessage() path:
if session.capabilities.Has(caps.Multiline) {
for _, line := range m.fullTagsMultiline {
session.sendBytes(line, false)
@ -191,6 +195,7 @@ func (m *MessageCache) Send(session *Session) {
session.sendBytes(line, false)
}
} else {
// slowpath
session.sendSplitMsgFromClientInternal(false, m.source, m.accountName, m.tags, m.command, m.target, m.splitMessage)
}
}