From 06e00beea6b66a885e5aaec803465eb869275f7f Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 22 Nov 2017 23:57:40 -0800 Subject: [PATCH] OperUp: write tried_oper flag to irc.state, as attributes under irc are not persistant --- OperUp/plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OperUp/plugin.py b/OperUp/plugin.py index 41b1283..3ca0eb3 100644 --- a/OperUp/plugin.py +++ b/OperUp/plugin.py @@ -55,7 +55,7 @@ class OperUp(callbacks.Plugin): # Don't try to oper more than once per network: otherwise we can hit # infinite loops if OPERMOTDs also use the regular MOTD numerics # (e.g. InspIRCd) - if hasattr(irc, '_operup_tried_oper'): + if hasattr(irc.state, '_operup_tried_oper'): return if irc.network in self.registryValue('operNets'): if self.registryValue("operName") and \ @@ -63,7 +63,7 @@ class OperUp(callbacks.Plugin): irc.sendMsg(ircmsgs.IrcMsg(command="OPER", args=[self.registryValue("operName"), self.registryValue("operPass")])) - irc._operup_tried_oper = True + irc.state._operup_tried_oper = True else: self.log.warning("OperUp: Bot is set to oper on network %s, but" " operName and/or operPass are not defined!", irc.network) @@ -109,7 +109,7 @@ class OperUp(callbacks.Plugin): irc.sendMsg(ircmsgs.IrcMsg(command="OPER", args=[self.registryValue("operName"), self.registryValue("operPass")])) - irc._operup_tried_oper = True + irc.state._operup_tried_oper = True irc.replySuccess() else: irc.error(_("Either the operName or the operPass "