Send CAP REQ
in 10-item chunks (src/IRCServer.py)
This commit is contained in:
parent
e1ceed2907
commit
23b0e58665
1 changed files with 6 additions and 3 deletions
|
@ -270,10 +270,13 @@ class Server(IRCObject.Object):
|
|||
self._capability_queue.update(capabilities)
|
||||
def send_capability_queue(self):
|
||||
if self.has_capability_queue():
|
||||
capabilities = " ".join(self._capability_queue)
|
||||
self.requested_capabilities = list(self._capability_queue)
|
||||
capability_queue = list(self._capability_queue)
|
||||
self._capability_queue.clear()
|
||||
self.send_capability_request(capabilities)
|
||||
|
||||
for i in range(0, len(capability_queue), 10):
|
||||
capability_batch = capability_queue[i:i+10]
|
||||
self.requested_capabilities += capability_batch
|
||||
self.send_capability_request(" ".join(capability_batch))
|
||||
def has_capability_queue(self):
|
||||
return bool(len(self._capability_queue))
|
||||
def send_capability_request(self, capability: str) -> IRCLine.Line:
|
||||
|
|
Loading…
Reference in a new issue