Format content of posts

master
Bob Mottram 2019-07-15 15:41:15 +01:00
parent 7a1a870e9e
commit f30f653c0a
1 changed files with 6 additions and 0 deletions

View File

@ -37,6 +37,7 @@ from utils import deletePost
from capabilities import getOcapFilename from capabilities import getOcapFilename
from capabilities import capabilitiesUpdate from capabilities import capabilitiesUpdate
from media import attachImage from media import attachImage
from content import addMentions
try: try:
from BeautifulSoup import BeautifulSoup from BeautifulSoup import BeautifulSoup
except ImportError: except ImportError:
@ -317,6 +318,10 @@ def createPostBase(baseDir: str,nickname: str, domain: str, port: int, \
inReplyTo=None, inReplyToAtomUri=None, subject=None) -> {}: inReplyTo=None, inReplyToAtomUri=None, subject=None) -> {}:
"""Creates a message """Creates a message
""" """
# convert content to html
content=addMentions(baseDir,httpPrefix, \
nickname,domain,content)
if port!=80 and port!=443: if port!=80 and port!=443:
domain=domain+':'+str(port) domain=domain+':'+str(port)
@ -335,6 +340,7 @@ def createPostBase(baseDir: str,nickname: str, domain: str, port: int, \
if subject: if subject:
summary=subject summary=subject
sensitive=True sensitive=True
if not clientToServer: if not clientToServer:
actorUrl=httpPrefix+'://'+domain+'/users/'+nickname actorUrl=httpPrefix+'://'+domain+'/users/'+nickname