diff --git a/newsdaemon.py b/newsdaemon.py index bb2e6d41..bc7b0239 100644 --- a/newsdaemon.py +++ b/newsdaemon.py @@ -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 diff --git a/utils.py b/utils.py index 0d3977e7..74f58ba5 100644 --- a/utils.py +++ b/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') -> []: diff --git a/webinterface.py b/webinterface.py index 7ca71879..9a8c7ed9 100644 --- a/webinterface.py +++ b/webinterface.py @@ -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,18 +4513,20 @@ def individualPostAsHtml(allowDownloads: bool, if fullDomain + '/users/' + nickname in postJsonObject['actor']: if '/statuses/' in postJsonObject['object']['id']: if isBlogPost(postJsonObject): - blogPostId = postJsonObject['object']['id'] - editStr += \ - ' ' + \ - '' + \ - '' + \
-                    translate['Edit blog post'] + \
-                    ' |\n' + if not isNewsPost(postJsonObject): + blogPostId = postJsonObject['object']['id'] + editStr += \ + ' ' + \ + '' + \ + '' + \
+                        translate['Edit blog post'] + \
+                        ' |\n' elif isEvent: eventPostId = postJsonObject['object']['id'] editStr += \