mirror of
https://github.com/ncoevoet/ChanTracker.git
synced 2025-04-26 13:01:06 -05:00
little changes for getBestPattern and vpn/*
This commit is contained in:
parent
63683c6739
commit
67ca04786c
@ -205,7 +205,7 @@ def getBestPattern (n,irc,useIp=False):
|
|||||||
if not n.prefix or not ircutils.isUserHostmask(n.prefix):
|
if not n.prefix or not ircutils.isUserHostmask(n.prefix):
|
||||||
return []
|
return []
|
||||||
(nick,ident,host) = ircutils.splitHostmask(n.prefix)
|
(nick,ident,host) = ircutils.splitHostmask(n.prefix)
|
||||||
if host.startswith('gateway/web/freenode/ip.') or host.startswith('gateway/tor-sasl/') or host.startswith('unaffiliated/') or ident.startswith('~'):
|
if host.startswith('gateway/web/freenode/ip.') or host.startswith('gateway/tor-sasl/') or host.startswith('gateway/vpn/') or host.startswith('unaffiliated/') or ident.startswith('~'):
|
||||||
ident = '*'
|
ident = '*'
|
||||||
if n.ip != None:
|
if n.ip != None:
|
||||||
if len(n.ip.split(':')) > 4:
|
if len(n.ip.split(':')) > 4:
|
||||||
@ -226,7 +226,7 @@ def getBestPattern (n,irc,useIp=False):
|
|||||||
host = '*%s' % host.split('ip.')[1]
|
host = '*%s' % host.split('ip.')[1]
|
||||||
else:
|
else:
|
||||||
h = host.split('/')
|
h = host.split('/')
|
||||||
if host.find('x-') != -1:
|
if host.find('x-') != -1 and host.find('vpn/') == -1:
|
||||||
# gateway/type/(domain|account) [?/random]
|
# gateway/type/(domain|account) [?/random]
|
||||||
p = ''
|
p = ''
|
||||||
if len(h) > 3:
|
if len(h) > 3:
|
||||||
@ -234,14 +234,11 @@ def getBestPattern (n,irc,useIp=False):
|
|||||||
h = h[:3]
|
h = h[:3]
|
||||||
host = '%s%s' % ('/'.join(h),p)
|
host = '%s%s' % ('/'.join(h),p)
|
||||||
(nick,i,h) = ircutils.splitHostmask(n.prefix)
|
(nick,i,h) = ircutils.splitHostmask(n.prefix)
|
||||||
if i.startswith('~'):
|
|
||||||
i = '*'
|
|
||||||
ident = i
|
|
||||||
elif host.startswith('nat/'):
|
elif host.startswith('nat/'):
|
||||||
h = host.replace('nat/','')
|
h = host.replace('nat/','')
|
||||||
if h.find('/') != -1:
|
if h.find('/') != -1:
|
||||||
host = 'nat/%s/*' % h.split('/')[0]
|
host = 'nat/%s/*' % h.split('/')[0]
|
||||||
if host.find('gateway/') != -1 and host.find('/x-') != -1:
|
if host.find('gateway/') != -1 and host.find('/x-') != -1 and host.find('vpn/') == -1:
|
||||||
host = '%s/*' % host.split('/x-')[0]
|
host = '%s/*' % host.split('/x-')[0]
|
||||||
k = '*!%s@%s' % (ident,host)
|
k = '*!%s@%s' % (ident,host)
|
||||||
if not k in results:
|
if not k in results:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user