Default cap_done to True, there's only one scenario were it is false (resume.py)

This commit is contained in:
jesopo 2019-02-17 16:00:33 +00:00
parent dc7cdf31d0
commit 3a3b197309

View file

@ -32,17 +32,15 @@ class Module(ModuleManager.BaseModule):
@utils.hook("received.resume") @utils.hook("received.resume")
def on_resume(self, event): def on_resume(self, event):
cap_done = False cap_done = True
if event["args"][0] == "SUCCESS": if event["args"][0] == "SUCCESS":
resume_channels = event["server"].get_setting("resume-channels", []) resume_channels = event["server"].get_setting("resume-channels", [])
self.log.info("Successfully resumed session", []) self.log.info("Successfully resumed session", [])
event["server"].cap_started = False event["server"].cap_started = False
cap_done = True
elif event["args"][0] == "ERR": elif event["args"][0] == "ERR":
self.log.info("Failed to resume session: %s", [event["args"][1]]) self.log.info("Failed to resume session: %s", [event["args"][1]])
cap_done = True
elif event["args"][0] == "TOKEN": elif event["args"][0] == "TOKEN":
token = self._get_token(event["server"]) token = self._get_token(event["server"])
@ -53,8 +51,7 @@ class Module(ModuleManager.BaseModule):
event["server"].send("RESUME %s%s" % event["server"].send("RESUME %s%s" %
(token, " %s" % timestamp if timestamp else "")) (token, " %s" % timestamp if timestamp else ""))
else: cap_done = False
cap_done = True
if cap_done: if cap_done:
event["server"].capability_done("resume") event["server"].capability_done("resume")