Browse Source

ensure that identical PRIVMSG share a time tag

tags/v1.0.0-rc1
Shivaram Lingamneni 5 years ago
parent
commit
b34bab16a7
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      irc/channel.go

+ 5
- 3
irc/channel.go View File

@@ -803,6 +803,8 @@ func (channel *Channel) sendSplitMessage(msgid, cmd string, histType history.Ite
803 803
 	nickmask := client.NickMaskString()
804 804
 	account := client.AccountName()
805 805
 
806
+	now := time.Now().UTC()
807
+
806 808
 	for _, member := range channel.Members() {
807 809
 		if minPrefix != nil && !channel.ClientIsAtLeast(member, minPrefixMode) {
808 810
 			// STATUSMSG
@@ -817,11 +819,10 @@ func (channel *Channel) sendSplitMessage(msgid, cmd string, histType history.Ite
817 819
 			tagsToUse = clientOnlyTags
818 820
 		}
819 821
 
820
-		// TODO(slingamn) evaluate an optimization where we reuse `nickmask` and `account`
821 822
 		if message == nil {
822
-			member.SendFromClient(msgid, client, tagsToUse, cmd, channel.name)
823
+			member.sendFromClientInternal(false, now, msgid, nickmask, account, tagsToUse, cmd, channel.name)
823 824
 		} else {
824
-			member.SendSplitMsgFromClient(msgid, client, tagsToUse, cmd, channel.name, *message)
825
+			member.sendSplitMsgFromClientInternal(false, now, msgid, nickmask, account, tagsToUse, cmd, channel.name, *message)
825 826
 		}
826 827
 	}
827 828
 
@@ -831,6 +832,7 @@ func (channel *Channel) sendSplitMessage(msgid, cmd string, histType history.Ite
831 832
 		Message:     *message,
832 833
 		Nick:        nickmask,
833 834
 		AccountName: account,
835
+		Time:        now,
834 836
 	})
835 837
 }
836 838
 

Loading…
Cancel
Save