mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
cdd1430c9b
commit
81ad6a7160
|
@ -20,7 +20,7 @@ from utils import getNicknameFromActor
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import locate_post
|
from utils import locate_post
|
||||||
from utils import save_json
|
from utils import save_json
|
||||||
from utils import undoAnnounceCollectionEntry
|
from utils import undo_announce_collection_entry
|
||||||
from utils import update_announce_collection
|
from utils import update_announce_collection
|
||||||
from utils import local_actor_url
|
from utils import local_actor_url
|
||||||
from utils import replace_users_with_at
|
from utils import replace_users_with_at
|
||||||
|
@ -96,7 +96,7 @@ def outboxAnnounce(recent_posts_cache: {},
|
||||||
post_filename = locate_post(base_dir, nickname, domain,
|
post_filename = locate_post(base_dir, nickname, domain,
|
||||||
message_json['object']['object'])
|
message_json['object']['object'])
|
||||||
if post_filename:
|
if post_filename:
|
||||||
undoAnnounceCollectionEntry(recent_posts_cache,
|
undo_announce_collection_entry(recent_posts_cache,
|
||||||
base_dir, post_filename,
|
base_dir, post_filename,
|
||||||
message_json['actor'],
|
message_json['actor'],
|
||||||
domain, debug)
|
domain, debug)
|
||||||
|
@ -416,7 +416,7 @@ def outboxUndoAnnounce(recent_posts_cache: {},
|
||||||
print('DEBUG: c2s undo announce post not found in inbox or outbox')
|
print('DEBUG: c2s undo announce post not found in inbox or outbox')
|
||||||
print(messageId)
|
print(messageId)
|
||||||
return True
|
return True
|
||||||
undoAnnounceCollectionEntry(recent_posts_cache, base_dir, post_filename,
|
undo_announce_collection_entry(recent_posts_cache, base_dir, post_filename,
|
||||||
message_json['actor'], domain, debug)
|
message_json['actor'], domain, debug)
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: post undo announce via c2s - ' + post_filename)
|
print('DEBUG: post undo announce via c2s - ' + post_filename)
|
||||||
|
|
4
inbox.py
4
inbox.py
|
@ -87,7 +87,7 @@ from blocking import isBlockedDomain
|
||||||
from blocking import broch_modeLapses
|
from blocking import broch_modeLapses
|
||||||
from filters import isFiltered
|
from filters import isFiltered
|
||||||
from utils import update_announce_collection
|
from utils import update_announce_collection
|
||||||
from utils import undoAnnounceCollectionEntry
|
from utils import undo_announce_collection_entry
|
||||||
from utils import dangerousMarkup
|
from utils import dangerousMarkup
|
||||||
from utils import is_dm
|
from utils import is_dm
|
||||||
from utils import is_reply
|
from utils import is_reply
|
||||||
|
@ -2079,7 +2079,7 @@ def _receiveUndoAnnounce(recent_posts_cache: {},
|
||||||
print("DEBUG: Attempt to undo something " +
|
print("DEBUG: Attempt to undo something " +
|
||||||
"which isn't an announcement")
|
"which isn't an announcement")
|
||||||
return False
|
return False
|
||||||
undoAnnounceCollectionEntry(recent_posts_cache, base_dir, post_filename,
|
undo_announce_collection_entry(recent_posts_cache, base_dir, post_filename,
|
||||||
message_json['actor'], domain, debug)
|
message_json['actor'], domain, debug)
|
||||||
if os.path.isfile(post_filename):
|
if os.path.isfile(post_filename):
|
||||||
try:
|
try:
|
||||||
|
|
7
utils.py
7
utils.py
|
@ -2339,9 +2339,10 @@ def undoReactionCollectionEntry(recent_posts_cache: {},
|
||||||
save_json(post_json_object, post_filename)
|
save_json(post_json_object, post_filename)
|
||||||
|
|
||||||
|
|
||||||
def undoAnnounceCollectionEntry(recent_posts_cache: {},
|
def undo_announce_collection_entry(recent_posts_cache: {},
|
||||||
base_dir: str, post_filename: str,
|
base_dir: str, post_filename: str,
|
||||||
actor: str, domain: str, debug: bool) -> None:
|
actor: str, domain: str,
|
||||||
|
debug: bool) -> None:
|
||||||
"""Undoes an announce for a particular actor by removing it from
|
"""Undoes an announce for a particular actor by removing it from
|
||||||
the "shares" collection within a post. Note that the "shares"
|
the "shares" collection within a post. Note that the "shares"
|
||||||
collection has no relation to shared items in shares.py. It's
|
collection has no relation to shared items in shares.py. It's
|
||||||
|
@ -2362,7 +2363,7 @@ def undoAnnounceCollectionEntry(recent_posts_cache: {},
|
||||||
os.remove(cachedPostFilename)
|
os.remove(cachedPostFilename)
|
||||||
except OSError:
|
except OSError:
|
||||||
if debug:
|
if debug:
|
||||||
print('EX: undoAnnounceCollectionEntry ' +
|
print('EX: undo_announce_collection_entry ' +
|
||||||
'unable to delete cached post ' +
|
'unable to delete cached post ' +
|
||||||
str(cachedPostFilename))
|
str(cachedPostFilename))
|
||||||
removePostFromCache(post_json_object, recent_posts_cache)
|
removePostFromCache(post_json_object, recent_posts_cache)
|
||||||
|
|
Loading…
Reference in New Issue