mirror of https://gitlab.com/bashrc2/epicyon
Clearing cache when new announce is received
parent
bbde34144f
commit
3b2237dc44
|
@ -48,7 +48,8 @@ def outboxAnnounce(recentPostsCache: {},
|
|||
messageJson['object'])
|
||||
if postFilename:
|
||||
updateAnnounceCollection(recentPostsCache, baseDir, postFilename,
|
||||
messageJson['actor'], domain, debug)
|
||||
messageJson['actor'],
|
||||
nickname, domain, debug)
|
||||
return True
|
||||
elif messageJson['type'] == 'Undo':
|
||||
if not isinstance(messageJson['object'], dict):
|
||||
|
|
2
inbox.py
2
inbox.py
|
@ -1398,7 +1398,7 @@ def _receiveAnnounce(recentPostsCache: {},
|
|||
print(messageJson['object'])
|
||||
return True
|
||||
updateAnnounceCollection(recentPostsCache, baseDir, postFilename,
|
||||
messageJson['actor'], domain, debug)
|
||||
messageJson['actor'], nickname, domain, debug)
|
||||
if debug:
|
||||
print('DEBUG: Downloading announce post ' + messageJson['actor'] +
|
||||
' -> ' + messageJson['object'])
|
||||
|
|
4
utils.py
4
utils.py
|
@ -2010,7 +2010,8 @@ def undoAnnounceCollectionEntry(recentPostsCache: {},
|
|||
|
||||
def updateAnnounceCollection(recentPostsCache: {},
|
||||
baseDir: str, postFilename: str,
|
||||
actor: str, domain: str, debug: bool) -> None:
|
||||
actor: str,
|
||||
nickname: str, domain: str, debug: bool) -> None:
|
||||
"""Updates the announcements collection within a post
|
||||
Confusingly this is known as "shares", but isn't the
|
||||
same as shared items within shares.py
|
||||
|
@ -2021,7 +2022,6 @@ def updateAnnounceCollection(recentPostsCache: {},
|
|||
return
|
||||
# remove any cached version of this announce so that the announce
|
||||
# icon is changed
|
||||
nickname = getNicknameFromActor(actor)
|
||||
cachedPostFilename = getCachedPostFilename(baseDir, nickname, domain,
|
||||
postJsonObject)
|
||||
if cachedPostFilename:
|
||||
|
|
|
@ -1320,7 +1320,7 @@ def individualPostAsHtml(allowDownloads: bool,
|
|||
if announceFilename:
|
||||
updateAnnounceCollection(recentPostsCache,
|
||||
baseDir, announceFilename,
|
||||
postActor, domainFull, False)
|
||||
postActor, nickname, domainFull, False)
|
||||
|
||||
# create a file for use by text-to-speech
|
||||
if isRecentPost(postJsonObject):
|
||||
|
|
Loading…
Reference in New Issue