From f4cfdf97221b7e71bb82faefa668c18695c61c25 Mon Sep 17 00:00:00 2001 From: Krytarik Raido Date: Mon, 28 Jun 2021 23:23:04 +0200 Subject: [PATCH] Apply the remainder of the changes. --- plugin.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/plugin.py b/plugin.py index 36f6c21..c6c518f 100644 --- a/plugin.py +++ b/plugin.py @@ -3222,19 +3222,12 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler): # send messages to logChannel if configured for if channel in irc.state.channels: logChannel = self.registryValue('logChannel', channel=channel) - i = self.getIrc(irc) - if logChannel in irc.state.channels: - if logChannel == channel and irc.state.channels[channel].isHalfopPlus(irc.nick) and self.registryValue('keepOp', channel=channel): - if self.registryValue('announceWithNotice', channel=channel): - i.lowQueue.enqueue(ircmsgs.notice(logChannel, message)) - else: - i.lowQueue.enqueue(ircmsgs.privmsg(logChannel, message)) - else: - if self.registryValue('announceWithNotice', channel=channel): - i.lowQueue.enqueue(ircmsgs.notice(logChannel, message)) - else: - i.lowQueue.enqueue(ircmsgs.privmsg(logChannel, message)) - elif len(logChannel) > 0: + if logChannel: + i = self.getIrc(irc) + if logChannel in irc.state.channels and logChannel == channel \ + and irc.state.channels[channel].isHalfopPlus(irc.nick) \ + and self.registryValue('keepOp', channel=channel): + logChannel = '@%s' % logChannel if self.registryValue('announceWithNotice', channel=channel): i.lowQueue.enqueue(ircmsgs.notice(logChannel, message)) else: