mirror of https://gitlab.com/bashrc2/epicyon
contentMap language for pinned posts
parent
f5cbc7f8ee
commit
9daac007f7
10
daemon.py
10
daemon.py
|
@ -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 \
|
||||
|
|
8
posts.py
8
posts.py
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue