diff --git a/modules/resume.py b/modules/resume.py index c3283bde..d37d9e89 100644 --- a/modules/resume.py +++ b/modules/resume.py @@ -1,3 +1,5 @@ +#--depends-on server_time + from src import ModuleManager, utils CAP = utils.irc.Capability(None, "draft/resume-0.4") @@ -12,13 +14,13 @@ class Module(ModuleManager.BaseModule): def _del_token(self, server, new=False): server.del_setting(self._setting(new)) - def _get_timestamp(self, server): - return server.get_setting("last-read", None) @utils.hook("new.server") def new_server(self, event): - resume_timestamp = self._get_timestamp(event["server"]) - event["server"]._resume_timestamp = resume_timestamp + # we need to pull this before any data has been exchanged - to make sure + # it's not overwritten from the last connection + event["server"]._resume_timestamp = event["server"].get_setting( + "last-server-time", None) @utils.hook("received.cap.ls") def on_cap_ls(self, event): diff --git a/src/IRCServer.py b/src/IRCServer.py index 3a4ff182..041dc0d8 100644 --- a/src/IRCServer.py +++ b/src/IRCServer.py @@ -239,9 +239,6 @@ class Server(IRCObject.Object): if lines: self.ping_sent = False - now = datetime.datetime.utcnow() - self.set_setting("last-read", - utils.iso8601_format(now, milliseconds=True)) return lines def send(self, line_parsed: IRCLine.ParsedLine):