From da18789946593c63efdf2782187ba7864c0b5809 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 10 Oct 2020 12:38:52 +0100 Subject: [PATCH] Don't process content for news posts --- newsdaemon.py | 2 -- posts.py | 21 +++++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/newsdaemon.py b/newsdaemon.py index f37f36ca..720c0183 100644 --- a/newsdaemon.py +++ b/newsdaemon.py @@ -146,8 +146,6 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str, blog['object']['url'] = \ httpPrefix + '://' + domain + '/@news/' + statusNumber blog['object']['published'] = dateStr - blog['object']['summary'] = rssTitle - blog['object']['content'] = rssDescription postId = newPostId.replace('/', '#') diff --git a/posts.py b/posts.py index e67503df..f63c8a2d 100644 --- a/posts.py +++ b/posts.py @@ -727,8 +727,11 @@ def createPostBase(baseDir: str, nickname: str, domain: str, port: int, """ subject = addAutoCW(baseDir, nickname, domain, subject, content) - mentionedRecipients = \ - getMentionedPeople(baseDir, httpPrefix, content, domain, False) + if nickname != 'news': + mentionedRecipients = \ + getMentionedPeople(baseDir, httpPrefix, content, domain, False) + else: + mentionedRecipients = '' tags = [] hashtagsDict = {} @@ -739,18 +742,20 @@ def createPostBase(baseDir: str, nickname: str, domain: str, port: int, domain = domain + ':' + str(port) # add tags - content = \ - addHtmlTags(baseDir, httpPrefix, - nickname, domain, content, - mentionedRecipients, - hashtagsDict, True) + if nickname != 'news': + content = \ + addHtmlTags(baseDir, httpPrefix, + nickname, domain, content, + mentionedRecipients, + hashtagsDict, True) # replace emoji with unicode tags = [] for tagName, tag in hashtagsDict.items(): tags.append(tag) # get list of tags - content = replaceEmojiFromTags(content, tags, 'content') + if nickname != 'news': + content = replaceEmojiFromTags(content, tags, 'content') # remove replaced emoji hashtagsDictCopy = hashtagsDict.copy() for tagName, tag in hashtagsDictCopy.items():