From 365eb9b318821bbcd57b5cd2c43d7edba3d19fa7 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Wed, 18 Sep 2019 16:16:09 -0400 Subject: [PATCH 1/2] offline removes the last check log --- sopel_modules/SpiceBot/Users.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sopel_modules/SpiceBot/Users.py b/sopel_modules/SpiceBot/Users.py index 643292c..1763dd2 100644 --- a/sopel_modules/SpiceBot/Users.py +++ b/sopel_modules/SpiceBot/Users.py @@ -373,26 +373,28 @@ class BotUsers(): nick_id = self.whois_ident(nick) # No registered check - if str(nick).lower() not in [x.lower() for x in list(self.dict["register_check"].keys())]: + if int(nick_id) not in list(self.dict["register_check"].keys()): check_whois = True - elif nick_id in self.dict["identified"]: - timestamp = self.dict["register_check"][str(nick).lower()] + elif int(nick_id) in self.dict["identified"]: + timestamp = self.dict["register_check"][int(nick_id)] if time.time() - timestamp >= 1800: check_whois = True else: - timestamp = self.dict["register_check"][str(nick).lower()] + timestamp = self.dict["register_check"][int(nick_id)] if time.time() - timestamp >= 240: check_whois = True if check_whois: bot.write(['WHOIS', str(nick)]) self.lock.acquire() - self.dict["register_check"][str(nick).lower()] = time.time() + self.dict["register_check"][int(nick_id)] = time.time() self.lock.release() def whois_identify_forget(self, nick_id): self.lock.acquire() if int(nick_id) in self.dict["identified"]: self.dict["identified"].remove(int(nick_id)) + if int(nick_id) in list(self.dict["register_check"].keys()): + del self.dict["register_check"][int(nick_id)] self.lock.release() def account(self, bot, trigger): From 8b156d39abfd17893b40f9e4149c3f2a5bf18f8b Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Wed, 18 Sep 2019 16:17:58 -0400 Subject: [PATCH 2/2] note --- sopel_modules/SpiceBot/Prerun.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sopel_modules/SpiceBot/Prerun.py b/sopel_modules/SpiceBot/Prerun.py index 4ea70f5..8e95fce 100644 --- a/sopel_modules/SpiceBot/Prerun.py +++ b/sopel_modules/SpiceBot/Prerun.py @@ -23,6 +23,9 @@ from .Users import users as botusers from .Events import events as botevents +# TODO check identify for OPs and bot admins + + def prerun(t_command_type='module', t_command_subtype=None): def actual_decorator(function):