diff --git a/irc/channel.go b/irc/channel.go index 73ad7806..5e79163b 100644 --- a/irc/channel.go +++ b/irc/channel.go @@ -975,7 +975,6 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod nickmask := client.NickMaskString() account := client.AccountName() chname := channel.Name() - now := time.Now().UTC() // STATUSMSG targets are prefixed with the supplied min-prefix, e.g., @#channel if minPrefixMode != modes.Mode(0) { @@ -983,7 +982,6 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod } // send echo-message - // TODO this should use `now` as the time for consistency if rb.session.capabilities.Has(caps.EchoMessage) { var tagsToUse map[string]string if rb.session.capabilities.Has(caps.MessageTags) { @@ -1005,9 +1003,9 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod tagsToUse = clientOnlyTags } if histType == history.Tagmsg && session.capabilities.Has(caps.MessageTags) { - session.sendFromClientInternal(false, now, message.Msgid, nickmask, account, tagsToUse, command, chname) + session.sendFromClientInternal(false, message.Time, message.Msgid, nickmask, account, tagsToUse, command, chname) } else { - session.sendSplitMsgFromClientInternal(false, now, nickmask, account, tagsToUse, command, chname, message) + session.sendSplitMsgFromClientInternal(false, nickmask, account, tagsToUse, command, chname, message) } } @@ -1030,9 +1028,9 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod } if histType == history.Tagmsg { - session.sendFromClientInternal(false, now, message.Msgid, nickmask, account, tagsToUse, command, chname) + session.sendFromClientInternal(false, message.Time, message.Msgid, nickmask, account, tagsToUse, command, chname) } else { - session.sendSplitMsgFromClientInternal(false, now, nickmask, account, tagsToUse, command, chname, message) + session.sendSplitMsgFromClientInternal(false, nickmask, account, tagsToUse, command, chname, message) } } } diff --git a/irc/client.go b/irc/client.go index 1801a7c6..ea01b658 100644 --- a/irc/client.go +++ b/irc/client.go @@ -1091,12 +1091,12 @@ func (client *Client) destroy(beingResumed bool, session *Session) { // SendSplitMsgFromClient sends an IRC PRIVMSG/NOTICE coming from a specific client. // Adds account-tag to the line as well. -func (session *Session) sendSplitMsgFromClientInternal(blocking bool, serverTime time.Time, nickmask, accountName string, tags map[string]string, command, target string, message utils.SplitMessage) { +func (session *Session) sendSplitMsgFromClientInternal(blocking bool, nickmask, accountName string, tags map[string]string, command, target string, message utils.SplitMessage) { if session.capabilities.Has(caps.MaxLine) || message.Wrapped == nil { - session.sendFromClientInternal(blocking, serverTime, message.Msgid, nickmask, accountName, tags, command, target, message.Message) + session.sendFromClientInternal(blocking, message.Time, message.Msgid, nickmask, accountName, tags, command, target, message.Message) } else { for _, messagePair := range message.Wrapped { - session.sendFromClientInternal(blocking, serverTime, messagePair.Msgid, nickmask, accountName, tags, command, target, messagePair.Message) + session.sendFromClientInternal(blocking, message.Time, messagePair.Msgid, nickmask, accountName, tags, command, target, messagePair.Message) } } } diff --git a/irc/handlers.go b/irc/handlers.go index 6b9a4f45..66ba8e35 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -2019,7 +2019,7 @@ func messageHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *R session.sendFromClientInternal(false, splitMsg.Time, splitMsg.Msgid, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick) } } else { - session.sendSplitMsgFromClientInternal(false, splitMsg.Time, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick, splitMsg) + session.sendSplitMsgFromClientInternal(false, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick, splitMsg) } } } @@ -2039,7 +2039,7 @@ func messageHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *R if histType == history.Tagmsg && rb.session.capabilities.Has(caps.MessageTags) { session.sendFromClientInternal(false, splitMsg.Time, splitMsg.Msgid, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick) } else { - session.sendSplitMsgFromClientInternal(false, splitMsg.Time, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick, splitMsg) + session.sendSplitMsgFromClientInternal(false, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick, splitMsg) } } if histType != history.Notice && user.Away() {