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
 	}
1246
 	}
1247
 
1247
 
1248
 	// send echo-message
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
 	for _, member := range channel.Members() {
1251
 	for _, member := range channel.Members() {
1252
 		if minPrefixMode != modes.Mode(0) && !channel.ClientIsAtLeast(member, minPrefixMode) {
1252
 		if minPrefixMode != modes.Mode(0) && !channel.ClientIsAtLeast(member, minPrefixMode) {

+ 3
- 2
irc/handlers.go View File

2042
 		_, isZNC := zncHandlers[lowercaseTarget]
2042
 		_, isZNC := zncHandlers[lowercaseTarget]
2043
 
2043
 
2044
 		if isService || isZNC {
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
 			if histType != history.Privmsg {
2047
 			if histType != history.Privmsg {
2047
 				return // NOTICE and TAGMSG to services are ignored
2048
 				return // NOTICE and TAGMSG to services are ignored
2048
 			}
2049
 			}
2108
 		}
2109
 		}
2109
 
2110
 
2110
 		// the originating session may get an echo message:
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
 		if histType != history.Notice {
2113
 		if histType != history.Notice {
2113
 			//TODO(dan): possibly implement cooldown of away notifications to users
2114
 			//TODO(dan): possibly implement cooldown of away notifications to users
2114
 			if away, awayMessage := user.Away(); away {
2115
 			if away, awayMessage := user.Away(); away {

+ 3
- 3
irc/responsebuffer.go View File

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
 	if rb.session.capabilities.Has(caps.EchoMessage) {
147
 	if rb.session.capabilities.Has(caps.EchoMessage) {
148
 		hasTagsCap := rb.session.capabilities.Has(caps.MessageTags)
148
 		hasTagsCap := rb.session.capabilities.Has(caps.MessageTags)
149
 		if command == "TAGMSG" {
149
 		if command == "TAGMSG" {
150
 			if hasTagsCap {
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
 		} else {
153
 		} else {
154
 			tagsToSend := tags
154
 			tagsToSend := tags
155
 			if !hasTagsCap {
155
 			if !hasTagsCap {
156
 				tagsToSend = nil
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