1
0
Fork 0
forked from External/ergo
This commit is contained in:
Shivaram Lingamneni 2020-07-24 02:37:36 -04:00
parent b3fd7e39f0
commit 28d4971f36
3 changed files with 28 additions and 49 deletions

View file

@ -2041,18 +2041,16 @@ func dispatchMessageToTarget(client *Client, tags map[string]string, histType hi
service, isService := OragonoServices[lowercaseTarget]
_, isZNC := zncHandlers[lowercaseTarget]
if histType == history.Privmsg {
if isService || isZNC {
rb.addEchoMessage(client.Details(), command, message, tags, target)
if histType != history.Privmsg {
return // NOTICE and TAGMSG to services are ignored
}
if isService {
servicePrivmsgHandler(service, server, client, message.Message, rb)
return
} else if isZNC {
zncPrivmsgHandler(client, lowercaseTarget, message.Message, rb)
return
}
}
// NOTICE and TAGMSG to services are ignored
if isService || isZNC {
return
}
@ -2110,18 +2108,7 @@ 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) {
hasTagsCap := rb.session.capabilities.Has(caps.MessageTags)
if histType == history.Tagmsg && hasTagsCap {
rb.AddFromClient(message.Time, message.Msgid, nickMaskString, accountName, tags, command, tnick)
} else {
tagsToSend := tags
if !hasTagsCap {
tagsToSend = nil
}
rb.AddSplitMessageFromClient(nickMaskString, accountName, tagsToSend, command, tnick, message)
}
}
rb.addEchoMessage(details, command, message, tags, tnick)
if histType != history.Notice {
//TODO(dan): possibly implement cooldown of away notifications to users
if away, awayMessage := user.Away(); away {