Kaynağa Gözat

fix #483

tags/v1.1.0-rc1
Shivaram Lingamneni 5 yıl önce
ebeveyn
işleme
6ded2ea466
3 değiştirilmiş dosya ile 9 ekleme ve 11 silme
  1. 4
    6
      irc/channel.go
  2. 3
    3
      irc/client.go
  3. 2
    2
      irc/handlers.go

+ 4
- 6
irc/channel.go Dosyayı Görüntüle

@@ -975,7 +975,6 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod
975 975
 	nickmask := client.NickMaskString()
976 976
 	account := client.AccountName()
977 977
 	chname := channel.Name()
978
-	now := time.Now().UTC()
979 978
 
980 979
 	// STATUSMSG targets are prefixed with the supplied min-prefix, e.g., @#channel
981 980
 	if minPrefixMode != modes.Mode(0) {
@@ -983,7 +982,6 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod
983 982
 	}
984 983
 
985 984
 	// send echo-message
986
-	// TODO this should use `now` as the time for consistency
987 985
 	if rb.session.capabilities.Has(caps.EchoMessage) {
988 986
 		var tagsToUse map[string]string
989 987
 		if rb.session.capabilities.Has(caps.MessageTags) {
@@ -1005,9 +1003,9 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod
1005 1003
 			tagsToUse = clientOnlyTags
1006 1004
 		}
1007 1005
 		if histType == history.Tagmsg && session.capabilities.Has(caps.MessageTags) {
1008
-			session.sendFromClientInternal(false, now, message.Msgid, nickmask, account, tagsToUse, command, chname)
1006
+			session.sendFromClientInternal(false, message.Time, message.Msgid, nickmask, account, tagsToUse, command, chname)
1009 1007
 		} else {
1010
-			session.sendSplitMsgFromClientInternal(false, now, nickmask, account, tagsToUse, command, chname, message)
1008
+			session.sendSplitMsgFromClientInternal(false, nickmask, account, tagsToUse, command, chname, message)
1011 1009
 		}
1012 1010
 	}
1013 1011
 
@@ -1030,9 +1028,9 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod
1030 1028
 			}
1031 1029
 
1032 1030
 			if histType == history.Tagmsg {
1033
-				session.sendFromClientInternal(false, now, message.Msgid, nickmask, account, tagsToUse, command, chname)
1031
+				session.sendFromClientInternal(false, message.Time, message.Msgid, nickmask, account, tagsToUse, command, chname)
1034 1032
 			} else {
1035
-				session.sendSplitMsgFromClientInternal(false, now, nickmask, account, tagsToUse, command, chname, message)
1033
+				session.sendSplitMsgFromClientInternal(false, nickmask, account, tagsToUse, command, chname, message)
1036 1034
 			}
1037 1035
 		}
1038 1036
 	}

+ 3
- 3
irc/client.go Dosyayı Görüntüle

@@ -1091,12 +1091,12 @@ func (client *Client) destroy(beingResumed bool, session *Session) {
1091 1091
 
1092 1092
 // SendSplitMsgFromClient sends an IRC PRIVMSG/NOTICE coming from a specific client.
1093 1093
 // Adds account-tag to the line as well.
1094
-func (session *Session) sendSplitMsgFromClientInternal(blocking bool, serverTime time.Time, nickmask, accountName string, tags map[string]string, command, target string, message utils.SplitMessage) {
1094
+func (session *Session) sendSplitMsgFromClientInternal(blocking bool, nickmask, accountName string, tags map[string]string, command, target string, message utils.SplitMessage) {
1095 1095
 	if session.capabilities.Has(caps.MaxLine) || message.Wrapped == nil {
1096
-		session.sendFromClientInternal(blocking, serverTime, message.Msgid, nickmask, accountName, tags, command, target, message.Message)
1096
+		session.sendFromClientInternal(blocking, message.Time, message.Msgid, nickmask, accountName, tags, command, target, message.Message)
1097 1097
 	} else {
1098 1098
 		for _, messagePair := range message.Wrapped {
1099
-			session.sendFromClientInternal(blocking, serverTime, messagePair.Msgid, nickmask, accountName, tags, command, target, messagePair.Message)
1099
+			session.sendFromClientInternal(blocking, message.Time, messagePair.Msgid, nickmask, accountName, tags, command, target, messagePair.Message)
1100 1100
 		}
1101 1101
 	}
1102 1102
 }

+ 2
- 2
irc/handlers.go Dosyayı Görüntüle

@@ -2019,7 +2019,7 @@ func messageHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *R
2019 2019
 							session.sendFromClientInternal(false, splitMsg.Time, splitMsg.Msgid, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick)
2020 2020
 						}
2021 2021
 					} else {
2022
-						session.sendSplitMsgFromClientInternal(false, splitMsg.Time, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick, splitMsg)
2022
+						session.sendSplitMsgFromClientInternal(false, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick, splitMsg)
2023 2023
 					}
2024 2024
 				}
2025 2025
 			}
@@ -2039,7 +2039,7 @@ func messageHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *R
2039 2039
 				if histType == history.Tagmsg && rb.session.capabilities.Has(caps.MessageTags) {
2040 2040
 					session.sendFromClientInternal(false, splitMsg.Time, splitMsg.Msgid, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick)
2041 2041
 				} else {
2042
-					session.sendSplitMsgFromClientInternal(false, splitMsg.Time, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick, splitMsg)
2042
+					session.sendSplitMsgFromClientInternal(false, nickMaskString, accountName, clientOnlyTags, msg.Command, tnick, splitMsg)
2043 2043
 				}
2044 2044
 			}
2045 2045
 			if histType != history.Notice && user.Away() {

Loading…
İptal
Kaydet