Only completely prevent CAP END
when we get RESUME SUCCESS
(resume.py)
This commit is contained in:
parent
be495344d4
commit
107205d29a
1 changed files with 10 additions and 2 deletions
|
@ -32,12 +32,17 @@ class Module(ModuleManager.BaseModule):
|
|||
|
||||
@utils.hook("received.resume")
|
||||
def on_resume(self, event):
|
||||
cap_done = False
|
||||
|
||||
if event["args"][0] == "SUCCESS":
|
||||
resume_channels = event["server"].get_setting("resume-channels", [])
|
||||
self.log.info("Successfully resumed session", [])
|
||||
event["server"].cap_started = False
|
||||
cap_done = True
|
||||
|
||||
elif event["args"][0] == "ERR":
|
||||
self.log.info("Failed to resume session: %s", [event["args"][1]])
|
||||
cap_done = True
|
||||
|
||||
elif event["args"][0] == "TOKEN":
|
||||
token = self._get_token(event["server"])
|
||||
|
@ -48,9 +53,12 @@ class Module(ModuleManager.BaseModule):
|
|||
|
||||
event["server"].send("RESUME %s%s" %
|
||||
(token, " %s" % timestamp if timestamp else ""))
|
||||
event["server"].cap_started = False
|
||||
else:
|
||||
cap_done = True
|
||||
|
||||
if cap_done:
|
||||
event["server"].capability_done("resume")
|
||||
|
||||
event["server"].capability_done("resume")
|
||||
|
||||
@utils.hook("received.001")
|
||||
def on_connect(self, event):
|
||||
|
|
Loading…
Reference in a new issue