mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-05-04 01:10:59 -05:00
parent
88c5cad072
commit
1d20f5afd5
@ -1,5 +1,5 @@
|
|||||||
###
|
###
|
||||||
# Copyright (c) 2014, James Lu (GLolol)
|
# Copyright (c) 2014,2018 James Lu <james@overdrivenetworks.com>
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -55,7 +55,7 @@ class OperUp(callbacks.Plugin):
|
|||||||
# Don't try to oper more than once per network: otherwise we can hit
|
# Don't try to oper more than once per network: otherwise we can hit
|
||||||
# infinite loops if OPERMOTDs also use the regular MOTD numerics
|
# infinite loops if OPERMOTDs also use the regular MOTD numerics
|
||||||
# (e.g. InspIRCd)
|
# (e.g. InspIRCd)
|
||||||
if hasattr(irc.state, '_operup_tried_oper'):
|
if hasattr(irc.state, '_operup_tried_oper') and irc.state._operup_tried_oper:
|
||||||
return
|
return
|
||||||
if irc.network in self.registryValue('operNets'):
|
if irc.network in self.registryValue('operNets'):
|
||||||
if self.registryValue("operName") and \
|
if self.registryValue("operName") and \
|
||||||
@ -70,6 +70,23 @@ class OperUp(callbacks.Plugin):
|
|||||||
|
|
||||||
do422 = do376
|
do422 = do376
|
||||||
|
|
||||||
|
# Unset irc.state_operup_tried_oper on disconnection.
|
||||||
|
def doError(self, irc, msg):
|
||||||
|
irc.state._operup_tried_oper = False
|
||||||
|
|
||||||
|
def doQuit(self, irc, msg):
|
||||||
|
if ircutils.strEqual(msg.nick, irc.nick):
|
||||||
|
irc.state._operup_tried_oper = False
|
||||||
|
|
||||||
|
def outFilter(self, irc, msg):
|
||||||
|
try:
|
||||||
|
if msg.command == 'QUIT' and ircutils.strEqual(msg.nick, irc.nick):
|
||||||
|
irc.state._operup_tried_oper = False
|
||||||
|
except:
|
||||||
|
self.log.exception('OperUp: caught error from outFilter on %s', irc.name)
|
||||||
|
finally:
|
||||||
|
return msg
|
||||||
|
|
||||||
def do381(self, irc, msg):
|
def do381(self, irc, msg):
|
||||||
self.log.info("OperUp: Received 381 (successfully opered up) from "
|
self.log.info("OperUp: Received 381 (successfully opered up) from "
|
||||||
"network %s.", irc.network)
|
"network %s.", irc.network)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user