mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-12 05:02:32 +01:00
Added some better logging.
This commit is contained in:
parent
4a6ac27406
commit
7b983bc921
20
src/ircdb.py
20
src/ircdb.py
@ -569,6 +569,7 @@ def checkIgnored(hostmask, recipient='', users=users, channels=channels):
|
|||||||
"""
|
"""
|
||||||
for ignore in conf.ignores:
|
for ignore in conf.ignores:
|
||||||
if ircutils.hostmaskPatternEqual(ignore, hostmask):
|
if ircutils.hostmaskPatternEqual(ignore, hostmask):
|
||||||
|
log.info('Ignoring %s due to conf.ignores.', hostmask)
|
||||||
return True
|
return True
|
||||||
try:
|
try:
|
||||||
id = users.getUserId(hostmask)
|
id = users.getUserId(hostmask)
|
||||||
@ -577,18 +578,31 @@ def checkIgnored(hostmask, recipient='', users=users, channels=channels):
|
|||||||
# If there's no user...
|
# If there's no user...
|
||||||
if ircutils.isChannel(recipient):
|
if ircutils.isChannel(recipient):
|
||||||
channel = channels.getChannel(recipient)
|
channel = channels.getChannel(recipient)
|
||||||
return channel.checkIgnored(hostmask)
|
if channel.checkIgnored(hostmask):
|
||||||
|
log.info('Ignoring %s due to the channel ignores.', hostmask)
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
return conf.defaultIgnore
|
return False
|
||||||
|
else:
|
||||||
|
if conf.defaultIgnore:
|
||||||
|
log.info('Ignoring %s due to conf.defaultIgnore', hostmask)
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
if user.checkCapability('owner'):
|
if user.checkCapability('owner'):
|
||||||
# Owners shouldn't ever be ignored.
|
# Owners shouldn't ever be ignored.
|
||||||
return False
|
return False
|
||||||
elif user.ignore:
|
elif user.ignore:
|
||||||
|
log.info('Ignoring %s due to his IrcUser ignore flag.', hostmask)
|
||||||
return True
|
return True
|
||||||
elif recipient:
|
elif recipient:
|
||||||
if ircutils.isChannel(recipient):
|
if ircutils.isChannel(recipient):
|
||||||
channel = channels.getChannel(recipient)
|
channel = channels.getChannel(recipient)
|
||||||
return channel.checkIgnored(hostmask)
|
if channel.checkIgnored(hostmask):
|
||||||
|
log.info('Ignoring %s due to the channel ignores.', hostmask)
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user