mirror of https://gitlab.com/bashrc2/epicyon
Less indentation
parent
f4da4d7512
commit
4a477bca88
37
inbox.py
37
inbox.py
|
|
@ -367,24 +367,27 @@ def inbox_permitted_message(domain: str, message_json: {},
|
||||||
'Follow', 'Join', 'Like', 'EmojiReact', 'Delete', 'Announce', 'Move',
|
'Follow', 'Join', 'Like', 'EmojiReact', 'Delete', 'Announce', 'Move',
|
||||||
'QuoteRequest', 'sm:ActorStatus', 'ActorStatus'
|
'QuoteRequest', 'sm:ActorStatus', 'ActorStatus'
|
||||||
)
|
)
|
||||||
if message_json['type'] not in always_allowed_types:
|
if message_json['type'] in always_allowed_types:
|
||||||
if not has_object_dict(message_json):
|
return True
|
||||||
return True
|
|
||||||
# reject messages generated by LLM
|
if not has_object_dict(message_json):
|
||||||
# See fep-c81b
|
return True
|
||||||
if 'agentAttribution' in message_json['object']:
|
|
||||||
if message_json['object'].get('id'):
|
# reject messages generated by LLM
|
||||||
print("REJECT: inbox post attributed to AI agent " +
|
# See fep-c81b
|
||||||
str(message_json['object']['id']))
|
if 'agentAttribution' in message_json['object']:
|
||||||
|
if message_json['object'].get('id'):
|
||||||
|
print("REJECT: inbox post attributed to AI agent " +
|
||||||
|
str(message_json['object']['id']))
|
||||||
|
return False
|
||||||
|
# if this is a reply check that replyTo is permitted
|
||||||
|
reply_id = get_reply_to(message_json['object'])
|
||||||
|
if reply_id:
|
||||||
|
in_reply_to = reply_id
|
||||||
|
if not isinstance(in_reply_to, str):
|
||||||
|
return False
|
||||||
|
if not url_permitted(in_reply_to, federation_list):
|
||||||
return False
|
return False
|
||||||
# if this is a reply check that replyTo is permitted
|
|
||||||
reply_id = get_reply_to(message_json['object'])
|
|
||||||
if reply_id:
|
|
||||||
in_reply_to = reply_id
|
|
||||||
if not isinstance(in_reply_to, str):
|
|
||||||
return False
|
|
||||||
if not url_permitted(in_reply_to, federation_list):
|
|
||||||
return False
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue