mirror of
https://gitlab.com/bashrc2/epicyon
synced 2026-11-01 18:29:54 +00:00
Reject self-boosts
These are easily abused by spammers
This commit is contained in:
1 parent
042664e9f8
commit
613e6b8945
2 files changed
+8
No files matched your search
@@ -32,6 +32,8 @@ def outboxAnnounce(recentPostsCache: {},
|
||||
"""
|
||||
if not messageJson.get('actor'):
|
||||
return False
|
||||
if not isinstance(messageJson['actor'], str):
|
||||
return False
|
||||
if not messageJson.get('type'):
|
||||
return False
|
||||
if not messageJson.get('object'):
|
||||
@@ -39,6 +41,8 @@ def outboxAnnounce(recentPostsCache: {},
|
||||
if messageJson['type'] == 'Announce':
|
||||
if not isinstance(messageJson['object'], str):
|
||||
return False
|
||||
if messageJson['actor'] in messageJson['object']:
|
||||
return False
|
||||
nickname = getNicknameFromActor(messageJson['actor'])
|
||||
if not nickname:
|
||||
print('WARN: no nickname found in ' + messageJson['actor'])
|
||||
|
||||
Reference in new issue
Block a user