mirror of
https://github.com/ncoevoet/ChanTracker.git
synced 2025-05-05 09:50:53 -05:00
Modified how uq/ue/ub/ui elements are computed if a hostmask is given
now the hostmask is checked against the active list that allows to do !uq $a:* which will removes all quiets on $a:<account>
This commit is contained in:
parent
22103587fa
commit
b1799be27c
15
plugin.py
15
plugin.py
@ -2174,28 +2174,33 @@ class ChanTracker(callbacks.Plugin,plugins.ChannelDBHandler):
|
|||||||
def _removes (self,irc,msg,args,channel,mode,items,perm=False):
|
def _removes (self,irc,msg,args,channel,mode,items,perm=False):
|
||||||
i = self.getIrc(irc)
|
i = self.getIrc(irc)
|
||||||
chan = self.getChan(irc,channel)
|
chan = self.getChan(irc,channel)
|
||||||
targets = []
|
targets = set([])
|
||||||
massremove = False
|
massremove = False
|
||||||
count = 0
|
count = 0
|
||||||
|
LL = chan.getItemsFor(self.getIrcdMode(irc,mode,'*!*@*')[0])
|
||||||
if mode in self.registryValue('modesToAsk',channel=channel) or mode in self.registryValue('modesToAskWhenOpped',channel=channel):
|
if mode in self.registryValue('modesToAsk',channel=channel) or mode in self.registryValue('modesToAskWhenOpped',channel=channel):
|
||||||
for item in items:
|
for item in items:
|
||||||
if item in i.nicks or item in irc.state.channels[channel].users:
|
if item in i.nicks or item in irc.state.channels[channel].users:
|
||||||
n = self.getNick(irc,item)
|
n = self.getNick(irc,item)
|
||||||
L = chan.getItemsFor(self.getIrcdMode(irc,mode,n.prefix)[0])
|
|
||||||
# here we check active items against Nick and add each pattern which matchs him
|
# here we check active items against Nick and add each pattern which matchs him
|
||||||
|
L = chan.getItemsFor(self.getIrcdMode(irc,mode,n.prefix)[0])
|
||||||
for pattern in L:
|
for pattern in L:
|
||||||
m = match(L[pattern].value,n,irc,self.registryValue('resolveIp'))
|
m = match(L[pattern].value,n,irc,self.registryValue('resolveIp'))
|
||||||
if m:
|
if m:
|
||||||
targets.append(L[pattern].value)
|
targets.add(L[pattern].value)
|
||||||
elif ircutils.isUserHostmask(item) or self.getIrcdExtbansPrefix(irc) in item:
|
elif ircutils.isUserHostmask(item) or self.getIrcdExtbansPrefix(irc) in item:
|
||||||
targets.append(item)
|
# previously we were adding directly the item to remove, now we check it agaisnt the active list
|
||||||
|
# that allows to uq $a:* and delete all the quiets on $a:something
|
||||||
|
for pattern in LL:
|
||||||
|
if ircutils.hostmaskPatternEqual(item,LL[pattern].value):
|
||||||
|
targets.add(LL[pattern].value)
|
||||||
elif item == '*':
|
elif item == '*':
|
||||||
massremove = True
|
massremove = True
|
||||||
targets = []
|
targets = []
|
||||||
if channel in list(irc.state.channels.keys()):
|
if channel in list(irc.state.channels.keys()):
|
||||||
L = chan.getItemsFor(self.getIrcdMode(irc,mode,'*!*@*')[0])
|
L = chan.getItemsFor(self.getIrcdMode(irc,mode,'*!*@*')[0])
|
||||||
for pattern in L:
|
for pattern in L:
|
||||||
targets.append(L[pattern].value)
|
targets.add(L[pattern].value)
|
||||||
break
|
break
|
||||||
f = None
|
f = None
|
||||||
if massremove:
|
if massremove:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user