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)
|
capabilities=capabilities)
|
||||||
elif subcommand == "ack":
|
elif subcommand == "ack":
|
||||||
event["server"].capabilities.update(capabilities)
|
event["server"].capabilities.update(capabilities)
|
||||||
if not is_multiline:
|
self._event(event, "cap.ack", capabilities=capabilities,
|
||||||
self._event(event, "cap.ack",
|
|
||||||
capabilities=event["server"].capabilities,
|
|
||||||
server=event["server"])
|
server=event["server"])
|
||||||
|
|
||||||
if event["server"].cap_started and not event["server"
|
if subcommand == "ack" or subcommand == "nak":
|
||||||
].waiting_for_capabilities():
|
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"].cap_started = False
|
||||||
event["server"].send_capability_end()
|
event["server"].send_capability_end()
|
||||||
elif subcommand == "nack":
|
|
||||||
event["server"].send_capability_end()
|
|
||||||
|
|
||||||
# the server is asking for authentication
|
# the server is asking for authentication
|
||||||
@utils.hook("raw.received.authenticate")
|
@utils.hook("raw.received.authenticate")
|
||||||
|
|
|
@ -30,6 +30,7 @@ class Server(IRCObject.Object):
|
||||||
self._capability_queue = set([]) # type: typing.Set[str]
|
self._capability_queue = set([]) # type: typing.Set[str]
|
||||||
self._capabilities_waiting = set([]) # type: typing.Set[str]
|
self._capabilities_waiting = set([]) # type: typing.Set[str]
|
||||||
self.capabilities = 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.server_capabilities = {} # type: typing.Dict[str, str]
|
||||||
self.batches = {} # type: typing.Dict[str, utils.irc.IRCLine]
|
self.batches = {} # type: typing.Dict[str, utils.irc.IRCLine]
|
||||||
self.cap_started = False
|
self.cap_started = False
|
||||||
|
@ -363,6 +364,7 @@ class Server(IRCObject.Object):
|
||||||
def send_capability_queue(self):
|
def send_capability_queue(self):
|
||||||
if self.has_capability_queue():
|
if self.has_capability_queue():
|
||||||
capabilities = " ".join(self._capability_queue)
|
capabilities = " ".join(self._capability_queue)
|
||||||
|
self.requested_capabilities = list(self._capability_queue)
|
||||||
self._capability_queue.clear()
|
self._capability_queue.clear()
|
||||||
self.send_capability_request(capabilities)
|
self.send_capability_request(capabilities)
|
||||||
def has_capability_queue(self):
|
def has_capability_queue(self):
|
||||||
|
|
Loading…
Reference in a new issue