mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
30120348ee
commit
df168c656d
|
@ -73,11 +73,12 @@ def outboxAnnounce(recent_posts_cache: {},
|
||||||
if not nickname:
|
if not nickname:
|
||||||
print('WARN: no nickname found in ' + message_json['actor'])
|
print('WARN: no nickname found in ' + message_json['actor'])
|
||||||
return False
|
return False
|
||||||
domain, port = getDomainFromActor(message_json['actor'])
|
domain, _ = getDomainFromActor(message_json['actor'])
|
||||||
postFilename = locatePost(base_dir, nickname, domain,
|
postFilename = locatePost(base_dir, nickname, domain,
|
||||||
message_json['object'])
|
message_json['object'])
|
||||||
if postFilename:
|
if postFilename:
|
||||||
updateAnnounceCollection(recent_posts_cache, base_dir, postFilename,
|
updateAnnounceCollection(recent_posts_cache,
|
||||||
|
base_dir, postFilename,
|
||||||
message_json['actor'],
|
message_json['actor'],
|
||||||
nickname, domain, debug)
|
nickname, domain, debug)
|
||||||
return True
|
return True
|
||||||
|
@ -91,7 +92,7 @@ def outboxAnnounce(recent_posts_cache: {},
|
||||||
if not nickname:
|
if not nickname:
|
||||||
print('WARN: no nickname found in ' + message_json['actor'])
|
print('WARN: no nickname found in ' + message_json['actor'])
|
||||||
return False
|
return False
|
||||||
domain, port = getDomainFromActor(message_json['actor'])
|
domain, _ = getDomainFromActor(message_json['actor'])
|
||||||
postFilename = locatePost(base_dir, nickname, domain,
|
postFilename = locatePost(base_dir, nickname, domain,
|
||||||
message_json['object']['object'])
|
message_json['object']['object'])
|
||||||
if postFilename:
|
if postFilename:
|
||||||
|
|
|
@ -4661,7 +4661,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# remove any previous cached news posts
|
# remove any previous cached news posts
|
||||||
newsId = removeIdEnding(post_json_object['object']['id'])
|
newsId = removeIdEnding(post_json_object['object']['id'])
|
||||||
newsId = newsId.replace('/', '#')
|
newsId = newsId.replace('/', '#')
|
||||||
clearFromPostCaches(base_dir, self.server.recent_posts_cache,
|
clearFromPostCaches(base_dir,
|
||||||
|
self.server.recent_posts_cache,
|
||||||
newsId)
|
newsId)
|
||||||
|
|
||||||
# save the news post
|
# save the news post
|
||||||
|
|
3
inbox.py
3
inbox.py
|
@ -1462,7 +1462,8 @@ def _receiveUndoReaction(recent_posts_cache: {},
|
||||||
if announceReactionFilename:
|
if announceReactionFilename:
|
||||||
postReactionId = announceReactionUrl
|
postReactionId = announceReactionUrl
|
||||||
postFilename = announceReactionFilename
|
postFilename = announceReactionFilename
|
||||||
undoReactionCollectionEntry(recent_posts_cache, base_dir,
|
undoReactionCollectionEntry(recent_posts_cache,
|
||||||
|
base_dir,
|
||||||
postFilename,
|
postFilename,
|
||||||
postReactionId,
|
postReactionId,
|
||||||
reactionActor, domain,
|
reactionActor, domain,
|
||||||
|
|
6
posts.py
6
posts.py
|
@ -3335,7 +3335,8 @@ def createRepliesTimeline(recent_posts_cache: {},
|
||||||
session, base_dir: str, nickname: str, domain: str,
|
session, base_dir: str, nickname: str, domain: str,
|
||||||
port: int, http_prefix: str, itemsPerPage: int,
|
port: int, http_prefix: str, itemsPerPage: int,
|
||||||
headerOnly: bool, pageNumber: int) -> {}:
|
headerOnly: bool, pageNumber: int) -> {}:
|
||||||
return _createBoxIndexed(recent_posts_cache, session, base_dir, 'tlreplies',
|
return _createBoxIndexed(recent_posts_cache, session,
|
||||||
|
base_dir, 'tlreplies',
|
||||||
nickname, domain, port, http_prefix,
|
nickname, domain, port, http_prefix,
|
||||||
itemsPerPage, headerOnly, True,
|
itemsPerPage, headerOnly, True,
|
||||||
0, False, 0, pageNumber)
|
0, False, 0, pageNumber)
|
||||||
|
@ -4500,7 +4501,8 @@ 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, recent_posts_cache)
|
rejectPostId(base_dir, nickname, domain, announcePostId,
|
||||||
|
recent_posts_cache)
|
||||||
|
|
||||||
# reject the post referenced by the announce activity object
|
# reject the post referenced by the announce activity object
|
||||||
if not os.path.isfile(announceFilename + '.reject'):
|
if not os.path.isfile(announceFilename + '.reject'):
|
||||||
|
|
Loading…
Reference in New Issue