From b34bab16a7adca182026fb3923ddd347076689bb Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 30 Dec 2018 15:20:44 -0500 Subject: [PATCH] ensure that identical PRIVMSG share a time tag --- irc/channel.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/irc/channel.go b/irc/channel.go index 8bfa487a..c28f54fe 100644 --- a/irc/channel.go +++ b/irc/channel.go @@ -803,6 +803,8 @@ func (channel *Channel) sendSplitMessage(msgid, cmd string, histType history.Ite nickmask := client.NickMaskString() account := client.AccountName() + now := time.Now().UTC() + for _, member := range channel.Members() { if minPrefix != nil && !channel.ClientIsAtLeast(member, minPrefixMode) { // STATUSMSG @@ -817,11 +819,10 @@ func (channel *Channel) sendSplitMessage(msgid, cmd string, histType history.Ite tagsToUse = clientOnlyTags } - // TODO(slingamn) evaluate an optimization where we reuse `nickmask` and `account` if message == nil { - member.SendFromClient(msgid, client, tagsToUse, cmd, channel.name) + member.sendFromClientInternal(false, now, msgid, nickmask, account, tagsToUse, cmd, channel.name) } 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, Nick: nickmask, AccountName: account, + Time: now, }) }