mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
2c88fb0f42
commit
fb9f938c2c
4
posts.py
4
posts.py
|
@ -42,7 +42,7 @@ from utils import get_base_content_from_post
|
||||||
from utils import remove_domain_port
|
from utils import remove_domain_port
|
||||||
from utils import get_port_from_domain
|
from utils import get_port_from_domain
|
||||||
from utils import has_object_dict
|
from utils import has_object_dict
|
||||||
from utils import rejectPostId
|
from utils import reject_post_id
|
||||||
from utils import removeInvalidChars
|
from utils import removeInvalidChars
|
||||||
from utils import fileLastModified
|
from utils import fileLastModified
|
||||||
from utils import isPublicPost
|
from utils import isPublicPost
|
||||||
|
@ -4501,7 +4501,7 @@ def _rejectAnnounce(announceFilename: str,
|
||||||
announcePostId: str, recent_posts_cache: {}):
|
announcePostId: str, recent_posts_cache: {}):
|
||||||
"""Marks an announce as rejected
|
"""Marks an announce as rejected
|
||||||
"""
|
"""
|
||||||
rejectPostId(base_dir, nickname, domain, announcePostId,
|
reject_post_id(base_dir, nickname, domain, announcePostId,
|
||||||
recent_posts_cache)
|
recent_posts_cache)
|
||||||
|
|
||||||
# reject the post referenced by the announce activity object
|
# reject the post referenced by the announce activity object
|
||||||
|
|
8
utils.py
8
utils.py
|
@ -2554,7 +2554,7 @@ def camelCaseSplit(text: str) -> str:
|
||||||
return resultStr.strip()
|
return resultStr.strip()
|
||||||
|
|
||||||
|
|
||||||
def rejectPostId(base_dir: str, nickname: str, domain: str,
|
def reject_post_id(base_dir: str, nickname: str, domain: str,
|
||||||
post_id: str, recent_posts_cache: {}) -> None:
|
post_id: str, recent_posts_cache: {}) -> None:
|
||||||
""" Marks the given post as rejected,
|
""" Marks the given post as rejected,
|
||||||
for example an announce which is too old
|
for example an announce which is too old
|
||||||
|
@ -2605,10 +2605,10 @@ def is_dm(post_json_object: {}) -> bool:
|
||||||
for f in fields:
|
for f in fields:
|
||||||
if not post_json_object['object'].get(f):
|
if not post_json_object['object'].get(f):
|
||||||
continue
|
continue
|
||||||
for toAddress in post_json_object['object'][f]:
|
for to_address in post_json_object['object'][f]:
|
||||||
if toAddress.endswith('#Public'):
|
if to_address.endswith('#Public'):
|
||||||
return False
|
return False
|
||||||
if toAddress.endswith('followers'):
|
if to_address.endswith('followers'):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ from utils import has_object_dict
|
||||||
from utils import updateAnnounceCollection
|
from utils import updateAnnounceCollection
|
||||||
from utils import is_pgp_encrypted
|
from utils import is_pgp_encrypted
|
||||||
from utils import is_dm
|
from utils import is_dm
|
||||||
from utils import rejectPostId
|
from utils import reject_post_id
|
||||||
from utils import isRecentPost
|
from utils import isRecentPost
|
||||||
from utils import get_config_param
|
from utils import get_config_param
|
||||||
from utils import get_full_domain
|
from utils import get_full_domain
|
||||||
|
@ -1510,7 +1510,7 @@ def individualPostAsHtml(signing_priv_key_pem: str,
|
||||||
if not postJsonAnnounce:
|
if not postJsonAnnounce:
|
||||||
# if the announce could not be downloaded then mark it as rejected
|
# if the announce could not be downloaded then mark it as rejected
|
||||||
announcedPostId = removeIdEnding(post_json_object['id'])
|
announcedPostId = removeIdEnding(post_json_object['id'])
|
||||||
rejectPostId(base_dir, nickname, domain, announcedPostId,
|
reject_post_id(base_dir, nickname, domain, announcedPostId,
|
||||||
recent_posts_cache)
|
recent_posts_cache)
|
||||||
return ''
|
return ''
|
||||||
post_json_object = postJsonAnnounce
|
post_json_object = postJsonAnnounce
|
||||||
|
|
Loading…
Reference in New Issue