don't "$r:name" => "name (realname)"
This commit is contained in:
parent
b69bbb439f
commit
d396fe0222
|
@ -338,7 +338,10 @@ def guessBanType(mask):
|
||||||
elif ircutils.isUserHostmask(mask) \
|
elif ircutils.isUserHostmask(mask) \
|
||||||
or mask[0] == '$' \
|
or mask[0] == '$' \
|
||||||
or mask.endswith('(realname)'):
|
or mask.endswith('(realname)'):
|
||||||
if not ('*' in mask or '?' in mask or '$' in mask):
|
if not ('*' in mask or \
|
||||||
|
'?' in mask or \
|
||||||
|
'$' in mask or \
|
||||||
|
' ' in mask):
|
||||||
# XXX hack over hack, we are supposing these are marks as normal
|
# XXX hack over hack, we are supposing these are marks as normal
|
||||||
# bans aren't usually set to exact match, while marks are.
|
# bans aren't usually set to exact match, while marks are.
|
||||||
return 'mark'
|
return 'mark'
|
||||||
|
@ -628,8 +631,6 @@ class Bantracker(callbacks.Plugin):
|
||||||
except KeyError:
|
except KeyError:
|
||||||
bans = self.bans[channel] = []
|
bans = self.bans[channel] = []
|
||||||
ban = Ban(msg.args)
|
ban = Ban(msg.args)
|
||||||
if ban.mask.startswith("$r:"):
|
|
||||||
ban.mask = ban.mask[3:] + " (realname)"
|
|
||||||
if ban not in bans:
|
if ban not in bans:
|
||||||
bans.append(ban)
|
bans.append(ban)
|
||||||
|
|
||||||
|
@ -1130,25 +1131,21 @@ class Bantracker(callbacks.Plugin):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# channel mask stuff
|
# channel mask stuff
|
||||||
realname = mask = ''
|
mask = ''
|
||||||
comment = None
|
comment = None
|
||||||
if mode[1] not in "bq":
|
if mode[1] not in "bq":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
mask = param[1]
|
mask = param[1]
|
||||||
if mask.startswith("$r:"):
|
|
||||||
mask = mask[3:]
|
|
||||||
realname = ' (realname)'
|
|
||||||
|
|
||||||
if mode[1] == 'q':
|
if mode[1] == 'q':
|
||||||
mask = '%' + mask
|
mask = '%' + mask
|
||||||
|
|
||||||
if mode[0] == '+':
|
if mode[0] == '+':
|
||||||
comment = self.getHostFromBan(irc, msg, mask)
|
comment = self.getHostFromBan(irc, msg, mask)
|
||||||
ban = self.doKickban(irc, channel, msg.prefix, mask + realname,
|
ban = self.doKickban(irc, channel, msg.prefix, mask,
|
||||||
extra_comment=comment)
|
extra_comment=comment)
|
||||||
elif mode[0] == '-':
|
elif mode[0] == '-':
|
||||||
self.doUnban(irc,channel, msg.nick, mask + realname)
|
self.doUnban(irc,channel, msg.nick, mask)
|
||||||
|
|
||||||
def getHostFromBan(self, irc, msg, mask):
|
def getHostFromBan(self, irc, msg, mask):
|
||||||
if irc not in self.lastStates:
|
if irc not in self.lastStates:
|
||||||
|
|
Loading…
Reference in New Issue