From f1abc5f10cc3b060f3a9137ac0ff6de02330a9cc Mon Sep 17 00:00:00 2001 From: jesopo Date: Sat, 22 Jun 2019 22:23:05 +0100 Subject: [PATCH] remove remove_own_mode( check - deferred_read.py better solves the issue. the issue was getting a MODE line on irc.com prior to 001, thus we didn't know what our nickname was thus we didn't know that the MODE was for us. not dying when we saw +x was easy to do with this check but I think it's more correct to actually parse that MODE after 001 so we know we have +x. --- src/IRCServer.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/IRCServer.py b/src/IRCServer.py index e7ee3422..0316cc60 100644 --- a/src/IRCServer.py +++ b/src/IRCServer.py @@ -158,11 +158,7 @@ class Server(IRCObject.Object): def add_own_mode(self, mode: str, arg: str=None): self.own_modes[mode] = arg def remove_own_mode(self, mode: str): - if mode in self.own_modes: - del self.own_modes[mode] - else: - self.bot.log.warn("Tried to remove unknown own mode %s on %s", - [mode, str(self)]) + del self.own_modes[mode] def change_own_mode(self, remove: bool, mode: str, arg: str=None): if remove: self.remove_own_mode(mode)