Manually count ACK/NAK for REQed CAPs before ENDing CAP negotiation
This commit is contained in:
parent
ff2d5ef7e7
commit
5991e02b0a
2 changed files with 11 additions and 10 deletions
|
@ -314,17 +314,16 @@ class Module(ModuleManager.BaseModule):
|
|||
capabilities=capabilities)
|
||||
elif subcommand == "ack":
|
||||
event["server"].capabilities.update(capabilities)
|
||||
if not is_multiline:
|
||||
self._event(event, "cap.ack",
|
||||
capabilities=event["server"].capabilities,
|
||||
self._event(event, "cap.ack", capabilities=capabilities,
|
||||
server=event["server"])
|
||||
|
||||
if event["server"].cap_started and not event["server"
|
||||
].waiting_for_capabilities():
|
||||
if subcommand == "ack" or subcommand == "nak":
|
||||
for capability in capabilities:
|
||||
event["server"].requested_capabilities.remove(capability)
|
||||
if (event["server"].cap_started and
|
||||
not event["server"].waiting_for_capabilities()):
|
||||
event["server"].cap_started = False
|
||||
event["server"].send_capability_end()
|
||||
elif subcommand == "nack":
|
||||
event["server"].send_capability_end()
|
||||
|
||||
# the server is asking for authentication
|
||||
@utils.hook("raw.received.authenticate")
|
||||
|
|
|
@ -30,6 +30,7 @@ class Server(IRCObject.Object):
|
|||
self._capability_queue = set([]) # type: typing.Set[str]
|
||||
self._capabilities_waiting = set([]) # type: typing.Set[str]
|
||||
self.capabilities = set([]) # type: typing.Set[str]
|
||||
self.requested_capabilities = [] # type: typing.List[str]
|
||||
self.server_capabilities = {} # type: typing.Dict[str, str]
|
||||
self.batches = {} # type: typing.Dict[str, utils.irc.IRCLine]
|
||||
self.cap_started = False
|
||||
|
@ -363,6 +364,7 @@ class Server(IRCObject.Object):
|
|||
def send_capability_queue(self):
|
||||
if self.has_capability_queue():
|
||||
capabilities = " ".join(self._capability_queue)
|
||||
self.requested_capabilities = list(self._capability_queue)
|
||||
self._capability_queue.clear()
|
||||
self.send_capability_request(capabilities)
|
||||
def has_capability_queue(self):
|
||||
|
|
Loading…
Reference in a new issue