mirror of https://gitlab.com/bashrc2/epicyon
Also remove cached html for cached referenced post in announce
parent
655771d0af
commit
d3e341b594
20
blocking.py
20
blocking.py
|
@ -473,8 +473,14 @@ def mutePost(baseDir: str, nickname: str, domain: str, port: int,
|
||||||
print('mutePost: ' + str(postJsonObject))
|
print('mutePost: ' + str(postJsonObject))
|
||||||
|
|
||||||
postJsonObj = postJsonObject
|
postJsonObj = postJsonObject
|
||||||
|
alsoUpdatePostId = None
|
||||||
if hasObjectDict(postJsonObject):
|
if hasObjectDict(postJsonObject):
|
||||||
postJsonObj = postJsonObject['object']
|
postJsonObj = postJsonObject['object']
|
||||||
|
else:
|
||||||
|
if postJsonObject.get('object'):
|
||||||
|
if isinstance(postJsonObject['object'], str):
|
||||||
|
alsoUpdatePostId = removeIdEnding(postJsonObject['object'])
|
||||||
|
|
||||||
domainFull = getFullDomain(domain, port)
|
domainFull = getFullDomain(domain, port)
|
||||||
actor = localActorUrl(httpPrefix, nickname, domainFull)
|
actor = localActorUrl(httpPrefix, nickname, domainFull)
|
||||||
|
|
||||||
|
@ -548,6 +554,10 @@ def mutePost(baseDir: str, nickname: str, domain: str, port: int,
|
||||||
if recentPostsCache['html'].get(postId):
|
if recentPostsCache['html'].get(postId):
|
||||||
del recentPostsCache['html'][postId]
|
del recentPostsCache['html'][postId]
|
||||||
print('MUTE: ' + postId + ' removed cached html')
|
print('MUTE: ' + postId + ' removed cached html')
|
||||||
|
if alsoUpdatePostId and recentPostsCache.get('html'):
|
||||||
|
if recentPostsCache['html'].get(alsoUpdatePostId):
|
||||||
|
del recentPostsCache['html'][alsoUpdatePostId]
|
||||||
|
print('MUTE: ' + alsoUpdatePostId + ' removed referenced html')
|
||||||
|
|
||||||
|
|
||||||
def unmutePost(baseDir: str, nickname: str, domain: str, port: int,
|
def unmutePost(baseDir: str, nickname: str, domain: str, port: int,
|
||||||
|
@ -571,8 +581,14 @@ def unmutePost(baseDir: str, nickname: str, domain: str, port: int,
|
||||||
print('UNMUTE: ' + muteFilename + ' file removed')
|
print('UNMUTE: ' + muteFilename + ' file removed')
|
||||||
|
|
||||||
postJsonObj = postJsonObject
|
postJsonObj = postJsonObject
|
||||||
|
alsoUpdatePostId = None
|
||||||
if hasObjectDict(postJsonObject):
|
if hasObjectDict(postJsonObject):
|
||||||
postJsonObj = postJsonObject['object']
|
postJsonObj = postJsonObject['object']
|
||||||
|
else:
|
||||||
|
if postJsonObject.get('object'):
|
||||||
|
if isinstance(postJsonObject['object'], str):
|
||||||
|
alsoUpdatePostId = removeIdEnding(postJsonObject['object'])
|
||||||
|
|
||||||
if postJsonObj.get('conversation'):
|
if postJsonObj.get('conversation'):
|
||||||
unmuteConversation(baseDir, nickname, domain,
|
unmuteConversation(baseDir, nickname, domain,
|
||||||
postJsonObj['conversation'])
|
postJsonObj['conversation'])
|
||||||
|
@ -626,6 +642,10 @@ def unmutePost(baseDir: str, nickname: str, domain: str, port: int,
|
||||||
if recentPostsCache['html'].get(postId):
|
if recentPostsCache['html'].get(postId):
|
||||||
del recentPostsCache['html'][postId]
|
del recentPostsCache['html'][postId]
|
||||||
print('UNMUTE: ' + postId + ' removed cached html')
|
print('UNMUTE: ' + postId + ' removed cached html')
|
||||||
|
if alsoUpdatePostId and recentPostsCache.get('html'):
|
||||||
|
if recentPostsCache['html'].get(alsoUpdatePostId):
|
||||||
|
del recentPostsCache['html'][alsoUpdatePostId]
|
||||||
|
print('MUTE: ' + alsoUpdatePostId + ' removed referenced html')
|
||||||
|
|
||||||
|
|
||||||
def outboxMute(baseDir: str, httpPrefix: str,
|
def outboxMute(baseDir: str, httpPrefix: str,
|
||||||
|
|
|
@ -8040,7 +8040,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
showPublicOnly = False
|
showPublicOnly = False
|
||||||
storeToCache = True
|
storeToCache = True
|
||||||
useCacheOnly = False
|
useCacheOnly = False
|
||||||
allowDownloads = True
|
allowDownloads = False
|
||||||
showAvatarOptions = True
|
showAvatarOptions = True
|
||||||
avatarUrl = None
|
avatarUrl = None
|
||||||
individualPostAsHtml(self.server.signingPrivateKeyPem,
|
individualPostAsHtml(self.server.signingPrivateKeyPem,
|
||||||
|
@ -8150,7 +8150,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
showPublicOnly = False
|
showPublicOnly = False
|
||||||
storeToCache = True
|
storeToCache = True
|
||||||
useCacheOnly = False
|
useCacheOnly = False
|
||||||
allowDownloads = True
|
allowDownloads = False
|
||||||
showAvatarOptions = True
|
showAvatarOptions = True
|
||||||
avatarUrl = None
|
avatarUrl = None
|
||||||
individualPostAsHtml(self.server.signingPrivateKeyPem,
|
individualPostAsHtml(self.server.signingPrivateKeyPem,
|
||||||
|
|
Loading…
Reference in New Issue