Browse Source

tweak addEchoMessage signature

tags/v2.3.0-rc1
Shivaram Lingamneni 3 years ago
parent
commit
6d18a1a78c
3 changed files with 7 additions and 6 deletions
  1. 1
    1
      irc/channel.go
  2. 3
    2
      irc/handlers.go
  3. 3
    3
      irc/responsebuffer.go

+ 1
- 1
irc/channel.go View File

@@ -1246,7 +1246,7 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod
1246 1246
 	}
1247 1247
 
1248 1248
 	// send echo-message
1249
-	rb.addEchoMessage(details, command, message, clientOnlyTags, chname)
1249
+	rb.addEchoMessage(clientOnlyTags, details.nickMask, details.accountName, command, chname, message)
1250 1250
 
1251 1251
 	for _, member := range channel.Members() {
1252 1252
 		if minPrefixMode != modes.Mode(0) && !channel.ClientIsAtLeast(member, minPrefixMode) {

+ 3
- 2
irc/handlers.go View File

@@ -2042,7 +2042,8 @@ func dispatchMessageToTarget(client *Client, tags map[string]string, histType hi
2042 2042
 		_, isZNC := zncHandlers[lowercaseTarget]
2043 2043
 
2044 2044
 		if isService || isZNC {
2045
-			rb.addEchoMessage(client.Details(), command, message, tags, target)
2045
+			details := client.Details()
2046
+			rb.addEchoMessage(tags, details.nickMask, details.accountName, command, target, message)
2046 2047
 			if histType != history.Privmsg {
2047 2048
 				return // NOTICE and TAGMSG to services are ignored
2048 2049
 			}
@@ -2108,7 +2109,7 @@ func dispatchMessageToTarget(client *Client, tags map[string]string, histType hi
2108 2109
 		}
2109 2110
 
2110 2111
 		// the originating session may get an echo message:
2111
-		rb.addEchoMessage(details, command, message, tags, tnick)
2112
+		rb.addEchoMessage(tags, nickMaskString, accountName, command, tnick, message)
2112 2113
 		if histType != history.Notice {
2113 2114
 			//TODO(dan): possibly implement cooldown of away notifications to users
2114 2115
 			if away, awayMessage := user.Away(); away {

+ 3
- 3
irc/responsebuffer.go View File

@@ -143,19 +143,19 @@ func (rb *ResponseBuffer) AddSplitMessageFromClient(fromNickMask string, fromAcc
143 143
 	}
144 144
 }
145 145
 
146
-func (rb *ResponseBuffer) addEchoMessage(details ClientDetails, command string, message utils.SplitMessage, tags map[string]string, target string) {
146
+func (rb *ResponseBuffer) addEchoMessage(tags map[string]string, nickMask, accountName, command, target string, message utils.SplitMessage) {
147 147
 	if rb.session.capabilities.Has(caps.EchoMessage) {
148 148
 		hasTagsCap := rb.session.capabilities.Has(caps.MessageTags)
149 149
 		if command == "TAGMSG" {
150 150
 			if hasTagsCap {
151
-				rb.AddFromClient(message.Time, message.Msgid, details.nickMask, details.accountName, tags, command, target)
151
+				rb.AddFromClient(message.Time, message.Msgid, nickMask, accountName, tags, command, target)
152 152
 			}
153 153
 		} else {
154 154
 			tagsToSend := tags
155 155
 			if !hasTagsCap {
156 156
 				tagsToSend = nil
157 157
 			}
158
-			rb.AddSplitMessageFromClient(details.nickMask, details.accountName, tagsToSend, command, target, message)
158
+			rb.AddSplitMessageFromClient(nickMask, accountName, tagsToSend, command, target, message)
159 159
 		}
160 160
 	}
161 161
 }

Loading…
Cancel
Save