mirror of https://gitlab.com/bashrc2/epicyon
Blocking debug
parent
28784cd7a2
commit
ef97b3c02f
11
blocking.py
11
blocking.py
|
@ -825,12 +825,17 @@ def is_blocked(base_dir: str, nickname: str, domain: str,
|
||||||
for blocked_str in blocked_cache:
|
for blocked_str in blocked_cache:
|
||||||
if block_nickname:
|
if block_nickname:
|
||||||
if block_nickname + '@*' in blocked_str:
|
if block_nickname + '@*' in blocked_str:
|
||||||
|
print('BLOCK: pattern ' +
|
||||||
|
block_nickname + '@* ' + blocked_str)
|
||||||
return True
|
return True
|
||||||
if block_domain:
|
if block_domain:
|
||||||
if '*@' + block_domain in blocked_str:
|
if '*@' + block_domain in blocked_str:
|
||||||
|
print('BLOCK: pattern ' +
|
||||||
|
'*@' + block_domain + ' ' + blocked_str)
|
||||||
return True
|
return True
|
||||||
if block_handle:
|
if block_handle:
|
||||||
if blocked_str == block_handle:
|
if blocked_str == block_handle:
|
||||||
|
print('BLOCK: pattern ' + block_handle)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
global_blocks_filename = data_dir(base_dir) + '/blocking.txt'
|
global_blocks_filename = data_dir(base_dir) + '/blocking.txt'
|
||||||
|
@ -838,12 +843,15 @@ def is_blocked(base_dir: str, nickname: str, domain: str,
|
||||||
if block_nickname:
|
if block_nickname:
|
||||||
if text_in_file(block_nickname + '@*\n',
|
if text_in_file(block_nickname + '@*\n',
|
||||||
global_blocks_filename):
|
global_blocks_filename):
|
||||||
|
print('BLOCK: global pattern ' + block_nickname + '@*')
|
||||||
return True
|
return True
|
||||||
if text_in_file('*@' + block_domain, global_blocks_filename):
|
if text_in_file('*@' + block_domain, global_blocks_filename):
|
||||||
|
print('BLOCK: global pattern *@' + block_domain)
|
||||||
return True
|
return True
|
||||||
if block_handle:
|
if block_handle:
|
||||||
block_str = block_handle + '\n'
|
block_str = block_handle + '\n'
|
||||||
if text_in_file(block_str, global_blocks_filename):
|
if text_in_file(block_str, global_blocks_filename):
|
||||||
|
print('BLOCK: global pattern ' + block_str)
|
||||||
return True
|
return True
|
||||||
if not block_federated:
|
if not block_federated:
|
||||||
federated_blocks_filename = \
|
federated_blocks_filename = \
|
||||||
|
@ -885,12 +893,15 @@ def is_blocked(base_dir: str, nickname: str, domain: str,
|
||||||
if os.path.isfile(blocking_filename):
|
if os.path.isfile(blocking_filename):
|
||||||
if block_nickname:
|
if block_nickname:
|
||||||
if text_in_file(block_nickname + '@*\n', blocking_filename):
|
if text_in_file(block_nickname + '@*\n', blocking_filename):
|
||||||
|
print('BLOCK: account pattern ' + block_nickname + '@*')
|
||||||
return True
|
return True
|
||||||
if block_domain:
|
if block_domain:
|
||||||
if text_in_file('*@' + block_domain + '\n', blocking_filename):
|
if text_in_file('*@' + block_domain + '\n', blocking_filename):
|
||||||
|
print('BLOCK: account pattern *@' + block_domain)
|
||||||
return True
|
return True
|
||||||
if block_handle:
|
if block_handle:
|
||||||
if text_in_file(block_handle + '\n', blocking_filename):
|
if text_in_file(block_handle + '\n', blocking_filename):
|
||||||
|
print('BLOCK: account pattern ' + block_handle)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue