Pārlūkot izejas kodu

fix #1411

Clients without event-playback should receive client-only tags in
replayed PRIVMSG / NOTICE.
tags/v2.5.0-rc1
Shivaram Lingamneni 3 gadus atpakaļ
vecāks
revīzija
e18eb1db99
1 mainītis faili ar 4 papildinājumiem un 3 dzēšanām
  1. 4
    3
      irc/client.go

+ 4
- 3
irc/client.go Parādīt failu

@@ -1050,7 +1050,8 @@ func (client *Client) replayPrivmsgHistory(rb *ResponseBuffer, items []history.I
1050 1050
 	}
1051 1051
 	batchID = rb.StartNestedHistoryBatch(target)
1052 1052
 
1053
-	allowTags := rb.session.capabilities.Has(caps.EventPlayback)
1053
+	hasEventPlayback := rb.session.capabilities.Has(caps.EventPlayback)
1054
+	hasTags := rb.session.capabilities.Has(caps.MessageTags)
1054 1055
 	for _, item := range items {
1055 1056
 		var command string
1056 1057
 		switch item.Type {
@@ -1059,7 +1060,7 @@ func (client *Client) replayPrivmsgHistory(rb *ResponseBuffer, items []history.I
1059 1060
 		case history.Notice:
1060 1061
 			command = "NOTICE"
1061 1062
 		case history.Tagmsg:
1062
-			if allowTags {
1063
+			if hasEventPlayback && hasTags {
1063 1064
 				command = "TAGMSG"
1064 1065
 			} else {
1065 1066
 				continue
@@ -1068,7 +1069,7 @@ func (client *Client) replayPrivmsgHistory(rb *ResponseBuffer, items []history.I
1068 1069
 			continue
1069 1070
 		}
1070 1071
 		var tags map[string]string
1071
-		if allowTags {
1072
+		if hasTags {
1072 1073
 			tags = item.Tags
1073 1074
 		}
1074 1075
 		// XXX: Params[0] is the message target. if the source of this message is an in-memory

Notiek ielāde…
Atcelt
Saglabāt