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