mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-26 20:14:20 +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,6 +79,7 @@ class IrcHandler(logging.Handler):
|
|||||||
if level > record.levelno:
|
if level > record.levelno:
|
||||||
msgOk = False
|
msgOk = False
|
||||||
|
|
||||||
|
if irc.isChannel(target):
|
||||||
if target in irc.state.channels:
|
if target in irc.state.channels:
|
||||||
channel = irc.state.channels[target]
|
channel = irc.state.channels[target]
|
||||||
modes = config.channelModesRequired.getSpecific(
|
modes = config.channelModesRequired.getSpecific(
|
||||||
@ -86,6 +87,8 @@ class IrcHandler(logging.Handler):
|
|||||||
for modeChar in modes:
|
for modeChar in modes:
|
||||||
if modeChar not in channel.modes:
|
if modeChar not in channel.modes:
|
||||||
msgOk = False
|
msgOk = False
|
||||||
|
else:
|
||||||
|
msgOk = False
|
||||||
else:
|
else:
|
||||||
capability = config.userCapabilityRequired.getSpecific()
|
capability = config.userCapabilityRequired.getSpecific()
|
||||||
if capability:
|
if capability:
|
||||||
|
Loading…
Reference in New Issue
Block a user