allows nick to be used as target for logChannel

This commit is contained in:
Nicolas Coevoet 2018-06-06 10:18:34 +02:00
parent 9874005392
commit 06013c8aa7
2 changed files with 7 additions and 7 deletions

View File

@ -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"""))

View File

@ -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,7 +2556,7 @@ 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)))
else:
elif len(logChannel) > 0:
if self.registryValue ('announceWithNotice',channel=channel):
i.lowQueue.enqueue(ircmsgs.notice(logChannel,message))
else: