mirror of https://gitlab.com/bashrc2/epicyon
Test the whole announce for blocked domains
parent
0f81cb05ff
commit
47d278b5d1
|
|
@ -1877,27 +1877,28 @@ def receive_announce(recent_posts_cache: {},
|
||||||
|
|
||||||
# Check that the domain of the announced post is not blocked
|
# Check that the domain of the announced post is not blocked
|
||||||
handle_nickname = handle.split('@')[0]
|
handle_nickname = handle.split('@')[0]
|
||||||
|
test_text = str(message_json)
|
||||||
if handle_nickname in block_military:
|
if handle_nickname in block_military:
|
||||||
if block_military[handle_nickname] is True and \
|
if block_military[handle_nickname] is True and \
|
||||||
contains_military_domain(announce_url):
|
contains_military_domain(test_text):
|
||||||
print('BLOCK: ' + handle_nickname +
|
print('BLOCK: ' + handle_nickname +
|
||||||
' blocked military domain announce')
|
' blocked military domain announce')
|
||||||
return False
|
return False
|
||||||
if handle_nickname in block_government:
|
if handle_nickname in block_government:
|
||||||
if block_government[handle_nickname] is True and \
|
if block_government[handle_nickname] is True and \
|
||||||
contains_government_domain(announce_url):
|
contains_government_domain(test_text):
|
||||||
print('BLOCK: ' + handle_nickname +
|
print('BLOCK: ' + handle_nickname +
|
||||||
' blocked government domain announce')
|
' blocked government domain announce')
|
||||||
return False
|
return False
|
||||||
if handle_nickname in block_bluesky:
|
if handle_nickname in block_bluesky:
|
||||||
if block_bluesky[handle_nickname] is True and \
|
if block_bluesky[handle_nickname] is True and \
|
||||||
contains_bluesky_domain(announce_url):
|
contains_bluesky_domain(test_text):
|
||||||
print('BLOCK: ' + handle_nickname +
|
print('BLOCK: ' + handle_nickname +
|
||||||
' blocked bluesky domain announce')
|
' blocked bluesky domain announce')
|
||||||
return False
|
return False
|
||||||
if handle_nickname in block_nostr:
|
if handle_nickname in block_nostr:
|
||||||
if block_nostr[handle_nickname] is True and \
|
if block_nostr[handle_nickname] is True and \
|
||||||
contains_nostr_domain(announce_url):
|
contains_nostr_domain(test_text):
|
||||||
print('BLOCK: ' + handle_nickname +
|
print('BLOCK: ' + handle_nickname +
|
||||||
' blocked nostr domain announce')
|
' blocked nostr domain announce')
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue