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

ensure that identical PRIVMSG share a time tag

This commit is contained in:
Shivaram Lingamneni 2018-12-30 15:20:44 -05:00
parent d5eade5494
commit b34bab16a7

View File

@ -803,6 +803,8 @@ func (channel *Channel) sendSplitMessage(msgid, cmd string, histType history.Ite
nickmask := client.NickMaskString() nickmask := client.NickMaskString()
account := client.AccountName() account := client.AccountName()
now := time.Now().UTC()
for _, member := range channel.Members() { for _, member := range channel.Members() {
if minPrefix != nil && !channel.ClientIsAtLeast(member, minPrefixMode) { if minPrefix != nil && !channel.ClientIsAtLeast(member, minPrefixMode) {
// STATUSMSG // STATUSMSG
@ -817,11 +819,10 @@ func (channel *Channel) sendSplitMessage(msgid, cmd string, histType history.Ite
tagsToUse = clientOnlyTags tagsToUse = clientOnlyTags
} }
// TODO(slingamn) evaluate an optimization where we reuse `nickmask` and `account`
if message == nil { if message == nil {
member.SendFromClient(msgid, client, tagsToUse, cmd, channel.name) member.sendFromClientInternal(false, now, msgid, nickmask, account, tagsToUse, cmd, channel.name)
} else { } else {
member.SendSplitMsgFromClient(msgid, client, tagsToUse, cmd, channel.name, *message) member.sendSplitMsgFromClientInternal(false, now, msgid, nickmask, account, tagsToUse, cmd, channel.name, *message)
} }
} }
@ -831,6 +832,7 @@ func (channel *Channel) sendSplitMessage(msgid, cmd string, histType history.Ite
Message: *message, Message: *message,
Nick: nickmask, Nick: nickmask,
AccountName: account, AccountName: account,
Time: now,
}) })
} }