Port numbers on image attachments

master
Bob Mottram 2019-07-28 19:06:20 +01:00
parent a60683afff
commit f8445f9f4c
2 changed files with 16 additions and 4 deletions

View File

@ -213,7 +213,7 @@ class PubServer(BaseHTTPRequestHandler):
os.rename(uploadMediaFilename,mediaFilename)
# change the url of the attachment
messageJson['object']['attachment'][attachmentIndex]['url']= \
self.server.httpPrefix+'://'+self.server.domain+'/'+mediaPath
self.server.httpPrefix+'://'+self.server.domainFull+'/'+mediaPath
permittedOutboxTypes=[
'Create','Announce','Like','Follow','Undo', \

View File

@ -607,9 +607,13 @@ def createPublicPost(baseDir: str,
inReplyTo=None, inReplyToAtomUri=None, subject=None) -> {}:
"""Public post
"""
domainFull=domain
if port!=80 and port!=443:
if ':' not in domain:
domainFull=domain+':'+str(port)
return createPostBase(baseDir,nickname, domain, port, \
'https://www.w3.org/ns/activitystreams#Public', \
httpPrefix+'://'+domain+'/users/'+nickname+'/followers', \
httpPrefix+'://'+domainFull+'/users/'+nickname+'/followers', \
httpPrefix, content, followersOnly, saveToFile, \
clientToServer, \
attachImageFilename,imageDescription,useBlurhash, \
@ -623,8 +627,12 @@ def createUnlistedPost(baseDir: str,
inReplyTo=None, inReplyToAtomUri=None, subject=None) -> {}:
"""Unlisted post. This has the #Public and followers links inverted.
"""
domainFull=domain
if port!=80 and port!=443:
if ':' not in domain:
domainFull=domain+':'+str(port)
return createPostBase(baseDir,nickname, domain, port, \
httpPrefix+'://'+domain+'/users/'+nickname+'/followers', \
httpPrefix+'://'+domainFull+'/users/'+nickname+'/followers', \
'https://www.w3.org/ns/activitystreams#Public', \
httpPrefix, content, followersOnly, saveToFile, \
clientToServer, \
@ -639,8 +647,12 @@ def createFollowersOnlyPost(baseDir: str,
inReplyTo=None, inReplyToAtomUri=None, subject=None) -> {}:
"""Followers only post
"""
domainFull=domain
if port!=80 and port!=443:
if ':' not in domain:
domainFull=domain+':'+str(port)
return createPostBase(baseDir,nickname, domain, port, \
httpPrefix+'://'+domain+'/users/'+nickname+'/followers', \
httpPrefix+'://'+domainFull+'/users/'+nickname+'/followers', \
None,
httpPrefix, content, followersOnly, saveToFile, \
clientToServer, \