From f30f653c0a40e07f79f60a33082d64c05d7170f4 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 15 Jul 2019 15:41:15 +0100 Subject: [PATCH] Format content of posts --- posts.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/posts.py b/posts.py index 49bf4528..19f64b3c 100644 --- a/posts.py +++ b/posts.py @@ -37,6 +37,7 @@ from utils import deletePost from capabilities import getOcapFilename from capabilities import capabilitiesUpdate from media import attachImage +from content import addMentions try: from BeautifulSoup import BeautifulSoup except ImportError: @@ -317,6 +318,10 @@ def createPostBase(baseDir: str,nickname: str, domain: str, port: int, \ inReplyTo=None, inReplyToAtomUri=None, subject=None) -> {}: """Creates a message """ + # convert content to html + content=addMentions(baseDir,httpPrefix, \ + nickname,domain,content) + if port!=80 and port!=443: domain=domain+':'+str(port) @@ -335,6 +340,7 @@ def createPostBase(baseDir: str,nickname: str, domain: str, port: int, \ if subject: summary=subject sensitive=True + if not clientToServer: actorUrl=httpPrefix+'://'+domain+'/users/'+nickname