forked from indymedia/epicyon
Include timeline parameter for like/repeat
parent
526f69c8b9
commit
ce76d3886c
28
daemon.py
28
daemon.py
|
@ -1006,6 +1006,11 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
pageNumberStr=pageNumberStr.split('?')[0]
|
||||
if pageNumberStr.isdigit():
|
||||
pageNumber=int(pageNumberStr)
|
||||
timelineStr='inbox'
|
||||
if '?tl=' in self.path:
|
||||
timelineStr=self.path.split('?tl=')[1]
|
||||
if '?' in timelineStr:
|
||||
timelineStr=timelineStr.split('?')[0]
|
||||
actor=self.path.split('?repeat=')[0]
|
||||
self.postToNickname=getNicknameFromActor(actor)
|
||||
if not self.postToNickname:
|
||||
|
@ -1034,7 +1039,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
if announceJson:
|
||||
self._postToOutboxThread(announceJson)
|
||||
self.server.GETbusy=False
|
||||
self._redirect_headers(actor+'/inbox?page='+str(pageNumber),cookie)
|
||||
self._redirect_headers(actor+'/'+timelineStr+'?page='+str(pageNumber),cookie)
|
||||
return
|
||||
|
||||
# undo an announce/repeat from the web interface
|
||||
|
@ -1049,6 +1054,11 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
pageNumberStr=pageNumberStr.split('?')[0]
|
||||
if pageNumberStr.isdigit():
|
||||
pageNumber=int(pageNumberStr)
|
||||
timelineStr='inbox'
|
||||
if '?tl=' in self.path:
|
||||
timelineStr=self.path.split('?tl=')[1]
|
||||
if '?' in timelineStr:
|
||||
timelineStr=timelineStr.split('?')[0]
|
||||
actor=self.path.split('?unrepeat=')[0]
|
||||
self.postToNickname=getNicknameFromActor(actor)
|
||||
if not self.postToNickname:
|
||||
|
@ -1076,7 +1086,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
}
|
||||
self._postToOutboxThread(newUndoAnnounce)
|
||||
self.server.GETbusy=False
|
||||
self._redirect_headers(actor+'/inbox?page='+str(pageNumber),cookie)
|
||||
self._redirect_headers(actor+'/'+timelineStr+'?page='+str(pageNumber),cookie)
|
||||
return
|
||||
|
||||
# send a follow request approval from the web interface
|
||||
|
@ -1140,6 +1150,11 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
pageNumberStr=pageNumberStr.split('?')[0]
|
||||
if pageNumberStr.isdigit():
|
||||
pageNumber=int(pageNumberStr)
|
||||
timelineStr='inbox'
|
||||
if '?tl=' in self.path:
|
||||
timelineStr=self.path.split('?tl=')[1]
|
||||
if '?' in timelineStr:
|
||||
timelineStr=timelineStr.split('?')[0]
|
||||
|
||||
self.postToNickname=getNicknameFromActor(actor)
|
||||
if not self.postToNickname:
|
||||
|
@ -1160,7 +1175,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
}
|
||||
self._postToOutboxThread(likeJson)
|
||||
self.server.GETbusy=False
|
||||
self._redirect_headers(actor+'/inbox?page='+str(pageNumber),cookie)
|
||||
self._redirect_headers(actor+'/'+timelineStr+'?page='+str(pageNumber),cookie)
|
||||
return
|
||||
|
||||
# undo a like from the web interface icon
|
||||
|
@ -1175,6 +1190,11 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
pageNumberStr=pageNumberStr.split('?')[0]
|
||||
if pageNumberStr.isdigit():
|
||||
pageNumber=int(pageNumberStr)
|
||||
timelineStr='inbox'
|
||||
if '?tl=' in self.path:
|
||||
timelineStr=self.path.split('?tl=')[1]
|
||||
if '?' in timelineStr:
|
||||
timelineStr=timelineStr.split('?')[0]
|
||||
actor=self.path.split('?unlike=')[0]
|
||||
self.postToNickname=getNicknameFromActor(actor)
|
||||
if not self.postToNickname:
|
||||
|
@ -1199,7 +1219,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
}
|
||||
self._postToOutboxThread(undoLikeJson)
|
||||
self.server.GETbusy=False
|
||||
self._redirect_headers(actor+'/inbox?page='+str(pageNumber),cookie)
|
||||
self._redirect_headers(actor+'/'+timelineStr+'?page='+str(pageNumber),cookie)
|
||||
return
|
||||
|
||||
# delete a post from the web interface icon
|
||||
|
|
|
@ -391,7 +391,7 @@ def htmlHashtagSearch(translate: {}, \
|
|||
baseDir,session,wfRequest,personCache, \
|
||||
nickname,domain,port,postJsonObject, \
|
||||
None,True,False, \
|
||||
httpPrefix,projectVersion, \
|
||||
httpPrefix,projectVersion,'inbox', \
|
||||
False,False,False,False)
|
||||
index-=1
|
||||
|
||||
|
@ -1078,7 +1078,7 @@ def htmlProfilePosts(translate: {}, \
|
|||
postStr=individualPostAsHtml(iconsDir,translate,None, \
|
||||
baseDir,session,wfRequest,personCache, \
|
||||
nickname,domain,port,item,None,True,False, \
|
||||
httpPrefix,projectVersion, \
|
||||
httpPrefix,projectVersion,'inbox', \
|
||||
False,False,False,True)
|
||||
if postStr:
|
||||
profileStr+=postStr
|
||||
|
@ -1650,6 +1650,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
|
|||
avatarUrl: str, showAvatarDropdown: bool,
|
||||
allowDeletion: bool, \
|
||||
httpPrefix: str, projectVersion: str, \
|
||||
boxName: str, \
|
||||
showRepeats=True, \
|
||||
showIcons=False, \
|
||||
manuallyApprovesFollowers=False, \
|
||||
|
@ -1952,7 +1953,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
|
|||
announceLink='unrepeat'
|
||||
announceTitle=translate['Undo the repeat']
|
||||
announceStr= \
|
||||
'<a href="/users/'+nickname+'?'+announceLink+'='+postJsonObject['object']['id']+pageNumberParam+'" title="'+announceTitle+'">' \
|
||||
'<a href="/users/'+nickname+'?tl='+boxName+'?'+announceLink+'='+postJsonObject['object']['id']+pageNumberParam+'" title="'+announceTitle+'">' \
|
||||
'<img src="/'+iconsDir+'/'+announceIcon+'"/></a>'
|
||||
|
||||
likeStr=''
|
||||
|
@ -1966,7 +1967,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
|
|||
likeLink='unlike'
|
||||
likeTitle=translate['Undo the like']
|
||||
likeStr= \
|
||||
'<a href="/users/'+nickname+'?'+likeLink+'='+postJsonObject['object']['id']+pageNumberParam+'" title="'+likeTitle+'">' \
|
||||
'<a href="/users/'+nickname+'?tl='+boxName+'?'+likeLink+'='+postJsonObject['object']['id']+pageNumberParam+'" title="'+likeTitle+'">' \
|
||||
'<img src="/'+iconsDir+'/'+likeIcon+'"/></a>'
|
||||
|
||||
deleteStr=''
|
||||
|
@ -2171,7 +2172,7 @@ def htmlTimeline(translate: {},pageNumber: int, \
|
|||
baseDir,session,wfRequest,personCache, \
|
||||
nickname,domain,port,item,avatarUrl,True, \
|
||||
allowDeletion, \
|
||||
httpPrefix,projectVersion, \
|
||||
httpPrefix,projectVersion,boxName, \
|
||||
boxName!='dm', \
|
||||
showIndividualPostIcons, \
|
||||
manuallyApproveFollowers,False)
|
||||
|
@ -2259,7 +2260,8 @@ def htmlIndividualPost(translate: {}, \
|
|||
individualPostAsHtml(iconsDir,translate,None, \
|
||||
baseDir,session,wfRequest,personCache, \
|
||||
nickname,domain,port,postJsonObject,None,True,False, \
|
||||
httpPrefix,projectVersion,False,authorized,False,False)
|
||||
httpPrefix,projectVersion,'inbox', \
|
||||
False,authorized,False,False)
|
||||
messageId=postJsonObject['id'].replace('/activity','')
|
||||
|
||||
# show the previous posts
|
||||
|
@ -2280,7 +2282,7 @@ def htmlIndividualPost(translate: {}, \
|
|||
baseDir,session,wfRequest,personCache, \
|
||||
nickname,domain,port,postJsonObject, \
|
||||
None,True,False, \
|
||||
httpPrefix,projectVersion, \
|
||||
httpPrefix,projectVersion,'inbox', \
|
||||
False,authorized,False,False)+postStr
|
||||
|
||||
# show the following posts
|
||||
|
@ -2298,7 +2300,7 @@ def htmlIndividualPost(translate: {}, \
|
|||
individualPostAsHtml(iconsDir,translate,None, \
|
||||
baseDir,session,wfRequest,personCache, \
|
||||
nickname,domain,port,item,None,True,False, \
|
||||
httpPrefix,projectVersion, \
|
||||
httpPrefix,projectVersion,'inbox', \
|
||||
False,authorized,False,False)
|
||||
cssFilename=baseDir+'/epicyon-profile.css'
|
||||
if os.path.isfile(baseDir+'/epicyon.css'):
|
||||
|
@ -2321,7 +2323,7 @@ def htmlPostReplies(translate: {},baseDir: str, \
|
|||
individualPostAsHtml(iconsDir,translate,None, \
|
||||
baseDir,session,wfRequest,personCache, \
|
||||
nickname,domain,port,item,None,True,False, \
|
||||
httpPrefix,projectVersion, \
|
||||
httpPrefix,projectVersion,'inbox', \
|
||||
False,False,False,False)
|
||||
|
||||
cssFilename=baseDir+'/epicyon-profile.css'
|
||||
|
@ -2429,7 +2431,7 @@ def htmlDeletePost(translate,pageNumber: int, \
|
|||
baseDir,session,wfRequest,personCache, \
|
||||
nickname,domain,port,postJsonObject, \
|
||||
None,True,False, \
|
||||
httpPrefix,projectVersion, \
|
||||
httpPrefix,projectVersion,'outbox', \
|
||||
False,False,False,False)
|
||||
deletePostStr+='<center>'
|
||||
deletePostStr+=' <p class="followText">'+translate['Delete this post?']+'</p>'
|
||||
|
@ -2855,7 +2857,7 @@ def htmlProfileAfterSearch(translate: {}, \
|
|||
session,wfRequest,personCache, \
|
||||
nickname,domain,port, \
|
||||
item,avatarUrl,False,False, \
|
||||
httpPrefix,projectVersion, \
|
||||
httpPrefix,projectVersion,'inbox', \
|
||||
False,False,False,False)
|
||||
i+=1
|
||||
if i>=20:
|
||||
|
|
Loading…
Reference in New Issue