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