contentMap language for pinned posts

main
Bob Mottram 2021-07-18 11:47:55 +01:00
parent f5cbc7f8ee
commit 9daac007f7
2 changed files with 10 additions and 8 deletions

View File

@ -9569,13 +9569,13 @@ class PubServer(BaseHTTPRequestHandler):
path: str,
httpPrefix: str,
nickname: str, domain: str,
domainFull: str):
domainFull: str, systemLanguage: str):
"""Returns the featured posts collections in
actor/collections/featured
"""
featuredCollection = \
jsonPinPost(baseDir, httpPrefix,
nickname, domain, domainFull)
nickname, domain, domainFull, systemLanguage)
msg = json.dumps(featuredCollection,
ensure_ascii=False).encode('utf-8')
msglen = len(msg)
@ -10795,7 +10795,8 @@ class PubServer(BaseHTTPRequestHandler):
getPinnedPostAsJson(self.server.baseDir,
self.server.httpPrefix,
nickname, self.server.domain,
self.server.domainFull)
self.server.domainFull,
self.server.systemLanguage)
messageJson = {}
if pinnedPostJson:
postId = pinnedPostJson['id']
@ -10827,7 +10828,8 @@ class PubServer(BaseHTTPRequestHandler):
self.path,
self.server.httpPrefix,
nickname, self.server.domain,
self.server.domainFull)
self.server.domainFull,
self.server.systemLanguage)
return
if not htmlGET and \

View File

@ -1342,7 +1342,7 @@ def undoPinnedPost(baseDir: str, nickname: str, domain: str) -> None:
def getPinnedPostAsJson(baseDir: str, httpPrefix: str,
nickname: str, domain: str,
domainFull: str) -> {}:
domainFull: str, systemLanguage: str) -> {}:
"""Returns the pinned profile post as json
"""
accountDir = acctDir(baseDir, nickname, domain)
@ -1363,7 +1363,7 @@ def getPinnedPostAsJson(baseDir: str, httpPrefix: str,
],
'content': pinnedContent,
'contentMap': {
'en': pinnedContent
systemLanguage: pinnedContent
},
'id': actor + '/pinned',
'inReplyTo': None,
@ -1382,13 +1382,13 @@ def getPinnedPostAsJson(baseDir: str, httpPrefix: str,
def jsonPinPost(baseDir: str, httpPrefix: str,
nickname: str, domain: str,
domainFull: str) -> {}:
domainFull: str, systemLanguage: str) -> {}:
"""Returns a pinned post as json
"""
pinnedPostJson = \
getPinnedPostAsJson(baseDir, httpPrefix,
nickname, domain,
domainFull)
domainFull, systemLanguage)
itemsList = []
if pinnedPostJson:
itemsList = [pinnedPostJson]