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 = \
|
idStr = \
|
||||||
httpPrefix + '://' + domain + '/users/news' + \
|
httpPrefix + '://' + domain + '/users/news' + \
|
||||||
'/statuses/' + statusNumber + '/replies'
|
'/statuses/' + statusNumber + '/replies'
|
||||||
|
blog['news'] = True
|
||||||
blog['object']['replies']['id'] = idStr
|
blog['object']['replies']['id'] = idStr
|
||||||
blog['object']['replies']['first']['partOf'] = idStr
|
blog['object']['replies']['first']['partOf'] = idStr
|
||||||
|
|
||||||
|
|
6
utils.py
6
utils.py
|
@ -979,6 +979,12 @@ def isBlogPost(postJsonObject: {}) -> bool:
|
||||||
return True
|
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,
|
def searchBoxPosts(baseDir: str, nickname: str, domain: str,
|
||||||
searchStr: str, maxResults: int,
|
searchStr: str, maxResults: int,
|
||||||
boxName='outbox') -> []:
|
boxName='outbox') -> []:
|
||||||
|
|
|
@ -30,6 +30,7 @@ from utils import getProtocolPrefixes
|
||||||
from utils import searchBoxPosts
|
from utils import searchBoxPosts
|
||||||
from utils import isEventPost
|
from utils import isEventPost
|
||||||
from utils import isBlogPost
|
from utils import isBlogPost
|
||||||
|
from utils import isNewsPost
|
||||||
from utils import updateRecentPostsCache
|
from utils import updateRecentPostsCache
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
|
@ -4512,10 +4513,12 @@ def individualPostAsHtml(allowDownloads: bool,
|
||||||
if fullDomain + '/users/' + nickname in postJsonObject['actor']:
|
if fullDomain + '/users/' + nickname in postJsonObject['actor']:
|
||||||
if '/statuses/' in postJsonObject['object']['id']:
|
if '/statuses/' in postJsonObject['object']['id']:
|
||||||
if isBlogPost(postJsonObject):
|
if isBlogPost(postJsonObject):
|
||||||
|
if not isNewsPost(postJsonObject):
|
||||||
blogPostId = postJsonObject['object']['id']
|
blogPostId = postJsonObject['object']['id']
|
||||||
editStr += \
|
editStr += \
|
||||||
' ' + \
|
' ' + \
|
||||||
'<a class="imageAnchor" href="/users/' + nickname + \
|
'<a class="imageAnchor" href="/users/' + \
|
||||||
|
nickname + \
|
||||||
'/tlblogs?editblogpost=' + \
|
'/tlblogs?editblogpost=' + \
|
||||||
blogPostId.split('/statuses/')[1] + \
|
blogPostId.split('/statuses/')[1] + \
|
||||||
'?actor=' + actorNickname + \
|
'?actor=' + actorNickname + \
|
||||||
|
|
Loading…
Reference in New Issue