forked from indymedia/epicyon
Extract liked actor
parent
0eba942667
commit
5781afad2c
13
daemon.py
13
daemon.py
|
@ -758,7 +758,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.session= \
|
self.server.session= \
|
||||||
createSession(self.server.domain,self.server.port,self.server.useTor)
|
createSession(self.server.domain,self.server.port,self.server.useTor)
|
||||||
likeActor=self.server.httpPrefix+'://'+self.server.domainFull+'/users/'+self.postToNickname
|
likeActor=self.server.httpPrefix+'://'+self.server.domainFull+'/users/'+self.postToNickname
|
||||||
actorLiked=self.path.split('/statuses/')[0]
|
actorLiked=likeUrl.split('/statuses/')[0]
|
||||||
likeJson= {
|
likeJson= {
|
||||||
'type': 'Like',
|
'type': 'Like',
|
||||||
'actor': likeActor,
|
'actor': likeActor,
|
||||||
|
@ -772,7 +772,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
return
|
return
|
||||||
|
|
||||||
# undo a like from the web interface icon
|
# undo a like from the web interface icon
|
||||||
if authorized and '?unlike=' in self.path:
|
if authorized and '?unlike=' in self.path and '/statuses/' in self.path:
|
||||||
likeUrl=self.path.split('?unlike=')[1]
|
likeUrl=self.path.split('?unlike=')[1]
|
||||||
actor=self.path.split('?unlike=')[0]
|
actor=self.path.split('?unlike=')[0]
|
||||||
self.postToNickname=getNicknameFromActor(actor)
|
self.postToNickname=getNicknameFromActor(actor)
|
||||||
|
@ -780,6 +780,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.session= \
|
self.server.session= \
|
||||||
createSession(self.server.domain,self.server.port,self.server.useTor)
|
createSession(self.server.domain,self.server.port,self.server.useTor)
|
||||||
undoActor=self.server.httpPrefix+'://'+self.server.domainFull+'/users/'+self.postToNickname
|
undoActor=self.server.httpPrefix+'://'+self.server.domainFull+'/users/'+self.postToNickname
|
||||||
|
actorLiked=likeUrl.split('/statuses/')[0]
|
||||||
undoLikeJson= {
|
undoLikeJson= {
|
||||||
'type': 'Undo',
|
'type': 'Undo',
|
||||||
'actor': undoActor,
|
'actor': undoActor,
|
||||||
|
@ -787,11 +788,11 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
'type': 'Like',
|
'type': 'Like',
|
||||||
'actor': undoActor,
|
'actor': undoActor,
|
||||||
'object': likeUrl,
|
'object': likeUrl,
|
||||||
'to': [undoActor+'/followers'],
|
'cc': [undoActor+'/followers'],
|
||||||
'cc': []
|
'to': [actorLiked]
|
||||||
},
|
},
|
||||||
'to': [undoActor+'/followers'],
|
'cc': [undoActor+'/followers'],
|
||||||
'cc': []
|
'to': [actorLiked]
|
||||||
}
|
}
|
||||||
self._postToOutbox(undoLikeJson)
|
self._postToOutbox(undoLikeJson)
|
||||||
self.server.GETbusy=False
|
self.server.GETbusy=False
|
||||||
|
|
Loading…
Reference in New Issue