Don't process content for news posts

main
Bob Mottram 2020-10-10 12:38:52 +01:00
parent eceb96ec49
commit da18789946
2 changed files with 13 additions and 10 deletions

View File

@ -146,8 +146,6 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str,
blog['object']['url'] = \ blog['object']['url'] = \
httpPrefix + '://' + domain + '/@news/' + statusNumber httpPrefix + '://' + domain + '/@news/' + statusNumber
blog['object']['published'] = dateStr blog['object']['published'] = dateStr
blog['object']['summary'] = rssTitle
blog['object']['content'] = rssDescription
postId = newPostId.replace('/', '#') postId = newPostId.replace('/', '#')

View File

@ -727,8 +727,11 @@ def createPostBase(baseDir: str, nickname: str, domain: str, port: int,
""" """
subject = addAutoCW(baseDir, nickname, domain, subject, content) subject = addAutoCW(baseDir, nickname, domain, subject, content)
mentionedRecipients = \ if nickname != 'news':
getMentionedPeople(baseDir, httpPrefix, content, domain, False) mentionedRecipients = \
getMentionedPeople(baseDir, httpPrefix, content, domain, False)
else:
mentionedRecipients = ''
tags = [] tags = []
hashtagsDict = {} hashtagsDict = {}
@ -739,18 +742,20 @@ def createPostBase(baseDir: str, nickname: str, domain: str, port: int,
domain = domain + ':' + str(port) domain = domain + ':' + str(port)
# add tags # add tags
content = \ if nickname != 'news':
addHtmlTags(baseDir, httpPrefix, content = \
nickname, domain, content, addHtmlTags(baseDir, httpPrefix,
mentionedRecipients, nickname, domain, content,
hashtagsDict, True) mentionedRecipients,
hashtagsDict, True)
# replace emoji with unicode # replace emoji with unicode
tags = [] tags = []
for tagName, tag in hashtagsDict.items(): for tagName, tag in hashtagsDict.items():
tags.append(tag) tags.append(tag)
# get list of tags # get list of tags
content = replaceEmojiFromTags(content, tags, 'content') if nickname != 'news':
content = replaceEmojiFromTags(content, tags, 'content')
# remove replaced emoji # remove replaced emoji
hashtagsDictCopy = hashtagsDict.copy() hashtagsDictCopy = hashtagsDict.copy()
for tagName, tag in hashtagsDictCopy.items(): for tagName, tag in hashtagsDictCopy.items():