diff --git a/config.py b/config.py index 68ace08..56aea2e 100644 --- a/config.py +++ b/config.py @@ -88,7 +88,7 @@ conf.registerChannelValue(ChanTracker, 'autoExpire', # announces related to logChannel conf.registerChannelValue(ChanTracker, 'logChannel', - registry.String("", """where bot announces op's actions; it is highly recommended to set an appropriate operator's channel to receive the various useful messages"""),opSettable=False) + registry.String("", """where bot announces op's actions; it is highly recommended to set an appropriate operator's channel to receive the various useful messages, nick can be used"""),opSettable=False) conf.registerChannelValue(ChanTracker, 'useColorForAnnounces', registry.Boolean(False, """use colors for announce messages""")) diff --git a/plugin.py b/plugin.py index 12f3017..32946e7 100644 --- a/plugin.py +++ b/plugin.py @@ -78,7 +78,7 @@ def matchHostmask (pattern,n,resolve): if '/' in host: if host.startswith('gateway/web/freenode/ip.'): n.ip = cache[n.prefix] = host.split('ip.')[1] - elif n.ip != None and '@' in pattern and mcidr.match(pattern.split('@')[1]): + if n.ip != None and '@' in pattern and mcidr.match(pattern.split('@')[1]): address = IPAddress('%s' % n.ip) network = IPNetwork('%s' % pattern.split('@')[1], strict=False) if address in network: @@ -2556,12 +2556,12 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler): i.lowQueue.enqueue(ircmsgs.IrcMsg('NOTICE @%s :%s' % (logChannel,message))) else: i.lowQueue.enqueue(ircmsgs.IrcMsg('PRIVMSG @%s :%s' % (logChannel,message))) + elif len(logChannel) > 0: + if self.registryValue ('announceWithNotice',channel=channel): + i.lowQueue.enqueue(ircmsgs.notice(logChannel,message)) else: - if self.registryValue ('announceWithNotice',channel=channel): - i.lowQueue.enqueue(ircmsgs.notice(logChannel,message)) - else: - i.lowQueue.enqueue(ircmsgs.privmsg(logChannel,message)) - self.forceTickle = True + i.lowQueue.enqueue(ircmsgs.privmsg(logChannel,message)) + self.forceTickle = True def resolve (self,irc,channels,prefix): i = self.getIrc(irc)