diff options
| author | 2018-11-09 10:43:05 +0000 | |
|---|---|---|
| committer | 2018-11-09 10:43:05 +0000 | |
| commit | 4bab1aea3094c2fa6cd8ba96a42eda905a933581 (patch) | |
| tree | 134fe7b75e872235a8183d10cee5436375a7be36 /modules | |
| parent | Filter out empty items in utils.parse.keyvalue (diff) | |
| signature | ||
Add a way to more explicitly denote when a CAP handshake has ended early
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/line_handler.py | 10 | ||||
| -rw-r--r-- | modules/resume.py | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/modules/line_handler.py b/modules/line_handler.py index bdb0c70b..dc38e675 100644 --- a/modules/line_handler.py +++ b/modules/line_handler.py @@ -265,6 +265,7 @@ class Module(ModuleManager.BaseModule): is_multiline = len(event["args"]) > 2 and event["args"][2] == "*" if subcommand == "ls": + event["server"].cap_started = True event["server"].server_capabilities.update(capabilities) if not is_multiline: matched_capabilities = set(event["server" @@ -292,13 +293,14 @@ class Module(ModuleManager.BaseModule): elif subcommand == "ack": event["server"].capabilities.update(capabilities) if not is_multiline: - results = self.events.on("received.cap.ack").call( + self.events.on("received.cap.ack").call( capabilities=event["server"].capabilities, server=event["server"]) - if not False in results: - if not event["server"].waiting_for_capabilities(): - event["server"].send_capability_end() + 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() diff --git a/modules/resume.py b/modules/resume.py index 21fa83e8..676602a5 100644 --- a/modules/resume.py +++ b/modules/resume.py @@ -17,7 +17,7 @@ class Module(ModuleManager.BaseModule): username, token = self._get_token(event["server"]) if CAP in event["capabilities"] and username and token: event["server"].send("RESUME %s %s" % (username, token)) - return False + event["server"].cap_started = False @utils.hook("received.resume") def on_resume(self, event): |
