diff --git a/daemon.py b/daemon.py index 29b7d8835..9127c7887 100644 --- a/daemon.py +++ b/daemon.py @@ -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', \ diff --git a/posts.py b/posts.py index 87a17aaf7..443aef798 100644 --- a/posts.py +++ b/posts.py @@ -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, \