merge-requests/30/head
Bob Mottram 2023-02-06 11:47:24 +00:00
parent 228bada5ab
commit fb088adcbe
2 changed files with 9 additions and 4 deletions

View File

@ -2701,6 +2701,7 @@ def _receive_announce(recent_posts_cache: {},
print('DEBUG: announce post not found in inbox or outbox') print('DEBUG: announce post not found in inbox or outbox')
print(message_json['object']) print(message_json['object'])
return True return True
# add actor to the list of announcers for a post
update_announce_collection(recent_posts_cache, base_dir, post_filename, update_announce_collection(recent_posts_cache, base_dir, post_filename,
message_json['actor'], nickname, domain, debug) message_json['actor'], nickname, domain, debug)
if debug: if debug:

View File

@ -362,7 +362,7 @@ def _save_individual_post_as_html_to_cache(base_dir: str,
with open(cached_post_filename, 'w+', encoding='utf-8') as fp_cache: with open(cached_post_filename, 'w+', encoding='utf-8') as fp_cache:
fp_cache.write(post_html) fp_cache.write(post_html)
return True return True
except Exception as ex: except OSError as ex:
print('ERROR: saving post to cache, ' + str(ex)) print('ERROR: saving post to cache, ' + str(ex))
return False return False
@ -2133,9 +2133,13 @@ def individual_post_as_html(signing_priv_key_pem: str,
translate, post_json_object['actor'], translate, post_json_object['actor'],
theme_name, system_language, theme_name, system_language,
box_name) box_name)
try:
with open(announce_filename + '.tts', 'w+', with open(announce_filename + '.tts', 'w+',
encoding='utf-8') as ttsfile: encoding='utf-8') as ttsfile:
ttsfile.write('\n') ttsfile.write('\n')
except OSError:
print('EX: unable to write tts ' +
announce_filename + '.tts')
is_announced = True is_announced = True