mirror of
https://github.com/ncoevoet/ChanTracker.git
synced 2025-04-26 13:01:06 -05:00
Fix UnboundLocalError in doTopic.
This commit is contained in:
parent
aca5b627d9
commit
3ef7520394
10
plugin.py
10
plugin.py
@ -113,7 +113,7 @@ def findPattern(text, minimalCount, minimalLength, minimalPercent):
|
|||||||
|
|
||||||
def matchHostmask(pattern, n, resolve):
|
def matchHostmask(pattern, n, resolve):
|
||||||
# return the matched pattern for Nick
|
# return the matched pattern for Nick
|
||||||
if n.prefix is None or not ircutils.isUserHostmask(n.prefix):
|
if not (n.prefix and ircutils.isUserHostmask(n.prefix)):
|
||||||
return None
|
return None
|
||||||
(nick, ident, host) = ircutils.splitHostmask(n.prefix)
|
(nick, ident, host) = ircutils.splitHostmask(n.prefix)
|
||||||
if '/' in host:
|
if '/' in host:
|
||||||
@ -3225,8 +3225,7 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
if account == '0':
|
if account == '0':
|
||||||
account = None
|
account = None
|
||||||
n = self.getNick(irc, nick)
|
n = self.getNick(irc, nick)
|
||||||
prefix = '%s!%s@%s' % (nick, ident, host)
|
n.setPrefix('%s!%s@%s' % (nick, ident, host))
|
||||||
n.setPrefix(prefix)
|
|
||||||
if self.registryValue('resolveIp') and n.ip is None and ip != '255.255.255.255':
|
if self.registryValue('resolveIp') and n.ip is None and ip != '255.255.255.255':
|
||||||
# validate ip
|
# validate ip
|
||||||
n.setIp(ip)
|
n.setIp(ip)
|
||||||
@ -4222,11 +4221,12 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler):
|
|||||||
def doTopic(self, irc, msg):
|
def doTopic(self, irc, msg):
|
||||||
if len(msg.args) == 1:
|
if len(msg.args) == 1:
|
||||||
return
|
return
|
||||||
|
n = None
|
||||||
if ircutils.isUserHostmask(msg.prefix):
|
if ircutils.isUserHostmask(msg.prefix):
|
||||||
n = self.getNick(irc, msg.nick)
|
n = self.getNick(irc, msg.nick)
|
||||||
|
if 'account' in msg.server_tags:
|
||||||
|
n.setAccount(msg.server_tags['account'])
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
if 'account' in msg.server_tags:
|
|
||||||
n.setAccount(msg.server_tags['account'])
|
|
||||||
if channel in irc.state.channels:
|
if channel in irc.state.channels:
|
||||||
if n:
|
if n:
|
||||||
n.addLog(channel, 'sets topic "%s"' % msg.args[1])
|
n.addLog(channel, 'sets topic "%s"' % msg.args[1])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user