diff --git a/inbox.py b/inbox.py index d4442e6f1..0b715abd6 100644 --- a/inbox.py +++ b/inbox.py @@ -658,11 +658,12 @@ def save_post_to_inbox_queue(base_dir: str, http_prefix: str, return None post_domain = get_full_domain(post_domain, post_port) + content_str = \ + get_base_content_from_post(post_json_object, system_language) + if has_object_dict(post_json_object): - if is_quote_toot(post_json_object): - if debug: - print('REJECT: inbox quote toot ' + str(post_json_object)) - return None + if is_quote_toot(post_json_object, content_str): + print('REJECT: inbox quote toot ' + str(post_json_object)) if post_json_object['object'].get('inReplyTo'): if isinstance(post_json_object['object']['inReplyTo'], str): in_reply_to = \ @@ -690,8 +691,6 @@ def save_post_to_inbox_queue(base_dir: str, http_prefix: str, return None # filter on the content of the post - content_str = \ - get_base_content_from_post(post_json_object, system_language) if content_str: summary_str = \ get_summary_from_post(post_json_object, @@ -3312,6 +3311,7 @@ def _like_notify(base_dir: str, domain: str, liker_handle = actor if liker_handle == handle: return + like_str = liker_handle + ' ' + url + '?likedBy=' + actor prev_like_file = account_dir + '/.prevLike' # was there a previous like notification? diff --git a/outbox.py b/outbox.py index eff60a035..d7762a395 100644 --- a/outbox.py +++ b/outbox.py @@ -265,7 +265,7 @@ def post_message_to_outbox(session, translate: {}, # check that the outgoing post doesn't contain any markup # which can be used to implement exploits if has_object_dict(message_json): - if is_quote_toot(message_json): + if is_quote_toot(message_json, ''): print('REJECT: POST quote toot ' + str(message_json)) return False diff --git a/utils.py b/utils.py index dad2c098e..3b8751a05 100644 --- a/utils.py +++ b/utils.py @@ -4161,7 +4161,7 @@ def save_reverse_timeline(base_dir: str, reverse_sequence: []) -> []: break -def is_quote_toot(post_json_object: str) -> bool: +def is_quote_toot(post_json_object: str, content: str) -> bool: """Returns true if the given post is a quote toot """ # Pleroma implementation @@ -4187,6 +4187,9 @@ def is_quote_toot(post_json_object: str) -> bool: if 'json' not in item['mediaType']: continue return True + if content: + if 'QT: ' in content: + return True return False