mirror of https://gitlab.com/bashrc2/epicyon
Try other fields to obtain block strings
parent
ca0ffdbd6b
commit
0e82d56cd0
11
blocking.py
11
blocking.py
|
@ -1933,7 +1933,10 @@ def _update_federated_blocks(session, base_dir: str,
|
|||
# a simple list of strings containing handles
|
||||
# or domains
|
||||
handle = block_dict
|
||||
if handle.startswith('@'):
|
||||
handle = handle[1:]
|
||||
if _valid_blocklist_entry(handle):
|
||||
if handle not in new_block_api_str:
|
||||
new_block_api_str += handle + '\n'
|
||||
if handle not in block_federated:
|
||||
block_federated.append(handle)
|
||||
|
@ -1941,15 +1944,17 @@ def _update_federated_blocks(session, base_dir: str,
|
|||
|
||||
if not isinstance(block_dict, dict):
|
||||
continue
|
||||
if not block_dict.get('username'):
|
||||
for block_fieldname in ('username', 'domain'):
|
||||
if not block_dict.get(block_fieldname):
|
||||
continue
|
||||
if not isinstance(block_dict['username'], str):
|
||||
if not isinstance(block_dict[block_fieldname], str):
|
||||
continue
|
||||
handle = block_dict['username']
|
||||
handle = block_dict[block_fieldname]
|
||||
if handle.startswith('@'):
|
||||
handle = handle[1:]
|
||||
if not _valid_blocklist_entry(handle):
|
||||
continue
|
||||
if handle not in new_block_api_str:
|
||||
new_block_api_str += handle + '\n'
|
||||
if handle not in block_federated:
|
||||
block_federated.append(handle)
|
||||
|
|
Loading…
Reference in New Issue