mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 04:32:36 +01:00
AutoMode: Prevent traceback if a unregistered user joins.
This commit is contained in:
parent
ae2f81356a
commit
dfbf74ba62
@ -87,15 +87,11 @@ class AutoMode(callbacks.Plugin):
|
|||||||
schedule.addEvent(f, time.time() + delay)
|
schedule.addEvent(f, time.time() + delay)
|
||||||
else:
|
else:
|
||||||
f()
|
f()
|
||||||
|
def extra_modes():
|
||||||
try:
|
try:
|
||||||
do('op')
|
|
||||||
if 'h' in irc.state.supported['prefix']:
|
|
||||||
do('halfop')
|
|
||||||
do('voice')
|
|
||||||
except Continue:
|
|
||||||
return
|
|
||||||
finally:
|
|
||||||
user = ircdb.users.getUser(ircdb.users.getUserId(msg.prefix))
|
user = ircdb.users.getUser(ircdb.users.getUserId(msg.prefix))
|
||||||
|
except KeyError:
|
||||||
|
return
|
||||||
pattern = re.compile('-|\+')
|
pattern = re.compile('-|\+')
|
||||||
for item in self.registryValue('extra', channel):
|
for item in self.registryValue('extra', channel):
|
||||||
try:
|
try:
|
||||||
@ -114,6 +110,15 @@ class AutoMode(callbacks.Plugin):
|
|||||||
([msg.nick]*len(pattern.sub('', modes)))
|
([msg.nick]*len(pattern.sub('', modes)))
|
||||||
schedule_msg(ircmsgs.mode(channel, modes), lambda :False)
|
schedule_msg(ircmsgs.mode(channel, modes), lambda :False)
|
||||||
break
|
break
|
||||||
|
try:
|
||||||
|
do('op')
|
||||||
|
if 'h' in irc.state.supported['prefix']:
|
||||||
|
do('halfop')
|
||||||
|
do('voice')
|
||||||
|
except Continue:
|
||||||
|
return
|
||||||
|
finally:
|
||||||
|
extra_modes()
|
||||||
c = ircdb.channels.getChannel(channel)
|
c = ircdb.channels.getChannel(channel)
|
||||||
if c.checkBan(msg.prefix) and self.registryValue('ban', channel):
|
if c.checkBan(msg.prefix) and self.registryValue('ban', channel):
|
||||||
period = self.registryValue('ban.period', channel)
|
period = self.registryValue('ban.period', channel)
|
||||||
|
Loading…
Reference in New Issue
Block a user