mirror of https://gitlab.com/bashrc2/epicyon
Indicate that imported posts contain news
parent
9e802d52eb
commit
eca0cbe982
|
@ -105,6 +105,7 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
|
|||
idStr = \
|
||||
httpPrefix + '://' + domain + '/users/news' + \
|
||||
'/statuses/' + statusNumber + '/replies'
|
||||
blog['news'] = True
|
||||
blog['object']['replies']['id'] = idStr
|
||||
blog['object']['replies']['first']['partOf'] = idStr
|
||||
|
||||
|
|
6
utils.py
6
utils.py
|
@ -979,6 +979,12 @@ def isBlogPost(postJsonObject: {}) -> bool:
|
|||
return True
|
||||
|
||||
|
||||
def isNewsPost(postJsonObject: {}) -> bool:
|
||||
"""Is the given post a blog post?
|
||||
"""
|
||||
return postJsonObject.get('news')
|
||||
|
||||
|
||||
def searchBoxPosts(baseDir: str, nickname: str, domain: str,
|
||||
searchStr: str, maxResults: int,
|
||||
boxName='outbox') -> []:
|
||||
|
|
|
@ -30,6 +30,7 @@ from utils import getProtocolPrefixes
|
|||
from utils import searchBoxPosts
|
||||
from utils import isEventPost
|
||||
from utils import isBlogPost
|
||||
from utils import isNewsPost
|
||||
from utils import updateRecentPostsCache
|
||||
from utils import getNicknameFromActor
|
||||
from utils import getDomainFromActor
|
||||
|
@ -4512,10 +4513,12 @@ def individualPostAsHtml(allowDownloads: bool,
|
|||
if fullDomain + '/users/' + nickname in postJsonObject['actor']:
|
||||
if '/statuses/' in postJsonObject['object']['id']:
|
||||
if isBlogPost(postJsonObject):
|
||||
if not isNewsPost(postJsonObject):
|
||||
blogPostId = postJsonObject['object']['id']
|
||||
editStr += \
|
||||
' ' + \
|
||||
'<a class="imageAnchor" href="/users/' + nickname + \
|
||||
'<a class="imageAnchor" href="/users/' + \
|
||||
nickname + \
|
||||
'/tlblogs?editblogpost=' + \
|
||||
blogPostId.split('/statuses/')[1] + \
|
||||
'?actor=' + actorNickname + \
|
||||
|
|
Loading…
Reference in New Issue