mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 20:52:42 +01:00
LogToIrc: Prevent loop when sending to non-existing channels
When the target is a channel it is not in, it would treat it as a user; which, if userCapabilityRequired is empty, would unconditionally send it to a channel. This would usually result in an error, that would be logged, hence the loop.
This commit is contained in:
parent
070090ffc5
commit
5b9ec4f716
@ -79,13 +79,16 @@ class IrcHandler(logging.Handler):
|
||||
if level > record.levelno:
|
||||
msgOk = False
|
||||
|
||||
if target in irc.state.channels:
|
||||
channel = irc.state.channels[target]
|
||||
modes = config.channelModesRequired.getSpecific(
|
||||
network=network)()
|
||||
for modeChar in modes:
|
||||
if modeChar not in channel.modes:
|
||||
msgOk = False
|
||||
if irc.isChannel(target):
|
||||
if target in irc.state.channels:
|
||||
channel = irc.state.channels[target]
|
||||
modes = config.channelModesRequired.getSpecific(
|
||||
network=network)()
|
||||
for modeChar in modes:
|
||||
if modeChar not in channel.modes:
|
||||
msgOk = False
|
||||
else:
|
||||
msgOk = False
|
||||
else:
|
||||
capability = config.userCapabilityRequired.getSpecific()
|
||||
if capability:
|
||||
|
Loading…
Reference in New Issue
Block a user