3
0
mirror of https://github.com/ergochat/ergo.git synced 2025-01-05 09:32:32 +01:00
This commit is contained in:
Shivaram Lingamneni 2019-05-13 00:39:59 -04:00
parent 0b55fed7c5
commit 6ded2ea466
3 changed files with 9 additions and 11 deletions

View File

@ -975,7 +975,6 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod
nickmask := client.NickMaskString() nickmask := client.NickMaskString()
account := client.AccountName() account := client.AccountName()
chname := channel.Name() chname := channel.Name()
now := time.Now().UTC()
// STATUSMSG targets are prefixed with the supplied min-prefix, e.g., @#channel // STATUSMSG targets are prefixed with the supplied min-prefix, e.g., @#channel
if minPrefixMode != modes.Mode(0) { if minPrefixMode != modes.Mode(0) {
@ -983,7 +982,6 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod
} }
// send echo-message // send echo-message
// TODO this should use `now` as the time for consistency
if rb.session.capabilities.Has(caps.EchoMessage) { if rb.session.capabilities.Has(caps.EchoMessage) {
var tagsToUse map[string]string var tagsToUse map[string]string
if rb.session.capabilities.Has(caps.MessageTags) { if rb.session.capabilities.Has(caps.MessageTags) {
@ -1005,9 +1003,9 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod
tagsToUse = clientOnlyTags tagsToUse = clientOnlyTags
} }
if histType == history.Tagmsg && session.capabilities.Has(caps.MessageTags) { 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 { } 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 { 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 { } else {
session.sendSplitMsgFromClientInternal(false, now, nickmask, account, tagsToUse, command, chname, message) session.sendSplitMsgFromClientInternal(false, nickmask, account, tagsToUse, command, chname, message)
} }
} }
} }

View File

@ -1091,12 +1091,12 @@ func (client *Client) destroy(beingResumed bool, session *Session) {
// SendSplitMsgFromClient sends an IRC PRIVMSG/NOTICE coming from a specific client. // SendSplitMsgFromClient sends an IRC PRIVMSG/NOTICE coming from a specific client.
// Adds account-tag to the line as well. // 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 { 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 { } else {
for _, messagePair := range message.Wrapped { 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)
} }
} }
} }

View File

@ -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) session.sendFromClientInternal(false, splitMsg.Time, splitMsg.Msgid, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick)
} }
} else { } 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) { if histType == history.Tagmsg && rb.session.capabilities.Has(caps.MessageTags) {
session.sendFromClientInternal(false, splitMsg.Time, splitMsg.Msgid, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick) session.sendFromClientInternal(false, splitMsg.Time, splitMsg.Msgid, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick)
} else { } 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() { if histType != history.Notice && user.Away() {