Get actor from path

main
Bob Mottram 2019-11-14 21:09:36 +00:00
parent 2835559d3e
commit b87e752d3b
1 changed files with 22 additions and 3 deletions

View File

@ -1382,6 +1382,9 @@ class PubServer(BaseHTTPRequestHandler):
if not self.server.session:
self.server.session= \
createSession(self.server.useTor)
self.server.actorRepeat=self.path.split('?actor=')[1]
if '?' in self.server.actorRepeat:
self.server.actorRepeat=self.server.actorRepeat.split('?')[0]
announceJson= \
createAnnounce(self.server.session, \
self.server.baseDir, \
@ -1432,6 +1435,9 @@ class PubServer(BaseHTTPRequestHandler):
if not self.server.session:
self.server.session= \
createSession(self.server.useTor)
self.server.actorRepeat=self.path.split('?actor=')[1]
if '?' in self.server.actorRepeat:
self.server.actorRepeat=self.server.actorRepeat.split('?')[0]
undoAnnounceActor= \
self.server.httpPrefix+'://'+self.server.domainFull+ \
'/users/'+self.postToNickname
@ -1541,13 +1547,16 @@ class PubServer(BaseHTTPRequestHandler):
likeActor= \
self.server.httpPrefix+'://'+ \
self.server.domainFull+'/users/'+self.postToNickname
self.server.actorLiked=self.path.split('?actor=')[1]
if '?' in self.server.actorLiked:
self.server.actorLiked=self.server.actorLiked.split('?')[0]
likeJson= {
"@context": "https://www.w3.org/ns/activitystreams",
'type': 'Like',
'actor': likeActor,
'object': likeUrl
}
self._postToOutboxThread(likeJson)
self._postToOutbox(likeJson)
self.server.GETbusy=False
self._redirect_headers(actor+'/'+timelineStr+ \
'?page='+str(pageNumber),cookie)
@ -1594,7 +1603,10 @@ class PubServer(BaseHTTPRequestHandler):
'object': likeUrl
}
}
self._postToOutboxThread(undoLikeJson)
self.server.actorLiked=self.path.split('?actor=')[1]
if '?' in self.server.actorLiked:
self.server.actorLiked=self.server.actorLiked.split('?')[0]
self._postToOutbox(undoLikeJson)
self.server.GETbusy=False
self._redirect_headers(actor+'/'+timelineStr+ \
'?page='+str(pageNumber),cookie)
@ -1656,6 +1668,7 @@ class PubServer(BaseHTTPRequestHandler):
replyToList=[]
replyPageNumber=1
shareDescription=None
replytoActor=None
if htmlGET:
# public reply
if '?replyto=' in self.path:
@ -1671,6 +1684,8 @@ class PubServer(BaseHTTPRequestHandler):
replyPageStr=m.replace('page=','')
if replyPageStr.isdigit():
replyPageNumber=int(replyPageStr)
if m.startswith('actor='):
replytoActor=m.replace('actor=','')
inReplyToUrl=mentionsList[0]
self.path=self.path.split('?replyto=')[0]+'/newpost'
if self.server.debug:
@ -1690,6 +1705,8 @@ class PubServer(BaseHTTPRequestHandler):
replyPageStr=m.replace('page=','')
if replyPageStr.isdigit():
replyPageNumber=int(replyPageStr)
if m.startswith('actor='):
replytoActor=m.replace('actor=','')
inReplyToUrl=mentionsList[0]
self.path=self.path.split('?replyfollowers=')[0]+'/newfollowers'
if self.server.debug:
@ -1709,6 +1726,8 @@ class PubServer(BaseHTTPRequestHandler):
replyPageStr=m.replace('page=','')
if replyPageStr.isdigit():
replyPageNumber=int(replyPageStr)
if m.startswith('actor='):
replytoActor=m.replace('actor=','')
inReplyToUrl=mentionsList[0]
if inReplyToUrl.startswith('sharedesc:'):
shareDescription= \