main
Bob Mottram 2025-11-17 18:20:19 +00:00
parent a33c94fe8c
commit 0869b6ece8
2 changed files with 10 additions and 8 deletions

View File

@ -5419,16 +5419,16 @@ def _expire_posts_for_person(http_prefix: str, nickname: str, domain: str,
continue continue
if is_dm(post_json_object): if is_dm(post_json_object):
continue continue
print('DEBUG: published_str ' + published_str + ' ' + if debug:
str(max_age_days)) print('DEBUG: deleting expired post ' + published_str + ' ' +
debug = True str(max_age_days))
if delete_post(base_dir, http_prefix, nickname, domain, if delete_post(base_dir, http_prefix, nickname, domain,
full_filename, debug, recent_posts_cache, True): full_filename, debug, recent_posts_cache, True):
expired_post_count += 1 expired_post_count += 1
debug = False
else: else:
print('DEBUG: retained published_str ' + published_str + ' ' + if debug:
str(max_age_days)) print('DEBUG: retained published_str ' + published_str + ' ' +
str(max_age_days))
return expired_post_count return expired_post_count

View File

@ -2229,7 +2229,8 @@ def delete_post(base_dir: str, http_prefix: str,
# i.e. DMs should only be removed if they are manually deleted # i.e. DMs should only be removed if they are manually deleted
if not manual: if not manual:
if _is_remote_dm(domain, post_json_object): if _is_remote_dm(domain, post_json_object):
print('DEBUG: remote DM not deleted ' + post_filename) if debug:
print('DEBUG: remote DM not deleted ' + post_filename)
return False return False
# don't allow deletion of bookmarked posts # don't allow deletion of bookmarked posts
@ -2241,7 +2242,8 @@ def delete_post(base_dir: str, http_prefix: str,
# don't remove replies to blog posts # don't remove replies to blog posts
if _is_reply_to_blog_post(base_dir, nickname, domain, if _is_reply_to_blog_post(base_dir, nickname, domain,
post_json_object): post_json_object):
print('DEBUG: reply to blog post not deleted ' + post_filename) if debug:
print('DEBUG: reply to blog post not deleted ' + post_filename)
return False return False
# remove from recent posts cache in memory # remove from recent posts cache in memory