Преглед на файлове

implement draft/no-implicit-names

tags/v2.12.0-rc1
Shivaram Lingamneni преди 10 месеца
родител
ревизия
3f74612e2b
променени са 4 файла, в които са добавени 21 реда и са изтрити 4 реда
  1. 6
    0
      gencapdefs.py
  2. 6
    1
      irc/caps/defs.go
  3. 6
    2
      irc/channel.go
  4. 3
    1
      irc/handlers.go

+ 6
- 0
gencapdefs.py Целия файл

213
         url="https://github.com/ircv3/ircv3-specifications/pull/506",
213
         url="https://github.com/ircv3/ircv3-specifications/pull/506",
214
         standard="IRCv3",
214
         standard="IRCv3",
215
     ),
215
     ),
216
+   CapDef(
217
+        identifier="NoImplicitNames",
218
+        name="draft/no-implicit-names",
219
+        url="https://github.com/ircv3/ircv3-specifications/pull/527",
220
+        standard="proposed IRCv3",
221
+    ),
216
 ]
222
 ]
217
 
223
 
218
 def validate_defs():
224
 def validate_defs():

+ 6
- 1
irc/caps/defs.go Целия файл

7
 
7
 
8
 const (
8
 const (
9
 	// number of recognized capabilities:
9
 	// number of recognized capabilities:
10
-	numCapabs = 33
10
+	numCapabs = 34
11
 	// length of the uint32 array that represents the bitset:
11
 	// length of the uint32 array that represents the bitset:
12
 	bitsetLen = 2
12
 	bitsetLen = 2
13
 )
13
 )
65
 	// https://github.com/ircv3/ircv3-specifications/pull/398
65
 	// https://github.com/ircv3/ircv3-specifications/pull/398
66
 	Multiline Capability = iota
66
 	Multiline Capability = iota
67
 
67
 
68
+	// NoImplicitNames is the proposed IRCv3 capability named "draft/no-implicit-names":
69
+	// https://github.com/ircv3/ircv3-specifications/pull/527
70
+	NoImplicitNames Capability = iota
71
+
68
 	// Persistence is the proposed IRCv3 capability named "draft/persistence":
72
 	// Persistence is the proposed IRCv3 capability named "draft/persistence":
69
 	// https://github.com/ircv3/ircv3-specifications/pull/503
73
 	// https://github.com/ircv3/ircv3-specifications/pull/503
70
 	Persistence Capability = iota
74
 	Persistence Capability = iota
162
 		"draft/languages",
166
 		"draft/languages",
163
 		"draft/message-redaction",
167
 		"draft/message-redaction",
164
 		"draft/multiline",
168
 		"draft/multiline",
169
+		"draft/no-implicit-names",
165
 		"draft/persistence",
170
 		"draft/persistence",
166
 		"draft/pre-away",
171
 		"draft/pre-away",
167
 		"draft/read-marker",
172
 		"draft/read-marker",

+ 6
- 2
irc/channel.go Целия файл

884
 	if rb.session.client == client {
884
 	if rb.session.client == client {
885
 		// don't send topic and names for a SAJOIN of a different client
885
 		// don't send topic and names for a SAJOIN of a different client
886
 		channel.SendTopic(client, rb, false)
886
 		channel.SendTopic(client, rb, false)
887
-		channel.Names(client, rb)
887
+		if !rb.session.capabilities.Has(caps.NoImplicitNames) {
888
+			channel.Names(client, rb)
889
+		}
888
 	} else {
890
 	} else {
889
 		// ensure that SAJOIN sends a MODE line to the originating client, if applicable
891
 		// ensure that SAJOIN sends a MODE line to the originating client, if applicable
890
 		if givenMode != 0 {
892
 		if givenMode != 0 {
975
 		sessionRb.Add(nil, client.server.name, "MARKREAD", chname, client.GetReadMarker(chcfname))
977
 		sessionRb.Add(nil, client.server.name, "MARKREAD", chname, client.GetReadMarker(chcfname))
976
 	}
978
 	}
977
 	channel.SendTopic(client, sessionRb, false)
979
 	channel.SendTopic(client, sessionRb, false)
978
-	channel.Names(client, sessionRb)
980
+	if !session.capabilities.Has(caps.NoImplicitNames) {
981
+		channel.Names(client, sessionRb)
982
+	}
979
 	sessionRb.Send(false)
983
 	sessionRb.Send(false)
980
 }
984
 }
981
 
985
 

+ 3
- 1
irc/handlers.go Целия файл

3169
 					targetRb.Add(nil, targetPrefix, "JOIN", newName)
3169
 					targetRb.Add(nil, targetPrefix, "JOIN", newName)
3170
 				}
3170
 				}
3171
 				channel.SendTopic(mcl, targetRb, false)
3171
 				channel.SendTopic(mcl, targetRb, false)
3172
-				channel.Names(mcl, targetRb)
3172
+				if !targetRb.session.capabilities.Has(caps.NoImplicitNames) {
3173
+					channel.Names(mcl, targetRb)
3174
+				}
3173
 			}
3175
 			}
3174
 			if mcl != client {
3176
 			if mcl != client {
3175
 				targetRb.Send(false)
3177
 				targetRb.Send(false)

Loading…
Отказ
Запис