mirror of https://gitlab.com/bashrc2/epicyon
parent
042664e9f8
commit
613e6b8945
|
@ -32,6 +32,8 @@ def outboxAnnounce(recentPostsCache: {},
|
||||||
"""
|
"""
|
||||||
if not messageJson.get('actor'):
|
if not messageJson.get('actor'):
|
||||||
return False
|
return False
|
||||||
|
if not isinstance(messageJson['actor'], str):
|
||||||
|
return False
|
||||||
if not messageJson.get('type'):
|
if not messageJson.get('type'):
|
||||||
return False
|
return False
|
||||||
if not messageJson.get('object'):
|
if not messageJson.get('object'):
|
||||||
|
@ -39,6 +41,8 @@ def outboxAnnounce(recentPostsCache: {},
|
||||||
if messageJson['type'] == 'Announce':
|
if messageJson['type'] == 'Announce':
|
||||||
if not isinstance(messageJson['object'], str):
|
if not isinstance(messageJson['object'], str):
|
||||||
return False
|
return False
|
||||||
|
if messageJson['actor'] in messageJson['object']:
|
||||||
|
return False
|
||||||
nickname = getNicknameFromActor(messageJson['actor'])
|
nickname = getNicknameFromActor(messageJson['actor'])
|
||||||
if not nickname:
|
if not nickname:
|
||||||
print('WARN: no nickname found in ' + messageJson['actor'])
|
print('WARN: no nickname found in ' + messageJson['actor'])
|
||||||
|
|
4
inbox.py
4
inbox.py
|
@ -1359,6 +1359,10 @@ def _receiveAnnounce(recentPostsCache: {},
|
||||||
'"users" or "profile" missing from actor in ' +
|
'"users" or "profile" missing from actor in ' +
|
||||||
messageJson['type'])
|
messageJson['type'])
|
||||||
return False
|
return False
|
||||||
|
if messageJson['actor'] in messageJson['object']:
|
||||||
|
if debug:
|
||||||
|
print('DEBUG: self-boost rejected')
|
||||||
|
return False
|
||||||
if not hasUsersPath(messageJson['object']):
|
if not hasUsersPath(messageJson['object']):
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: ' +
|
print('DEBUG: ' +
|
||||||
|
|
Loading…
Reference in New Issue