mirror of https://gitlab.com/bashrc2/epicyon
Return to bookmark position
parent
d683607d3c
commit
aa71738c6c
57
daemon.py
57
daemon.py
|
@ -1516,6 +1516,12 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
repeatUrl=self.path.split('?repeat=')[1]
|
repeatUrl=self.path.split('?repeat=')[1]
|
||||||
if '?' in repeatUrl:
|
if '?' in repeatUrl:
|
||||||
repeatUrl=repeatUrl.split('?')[0]
|
repeatUrl=repeatUrl.split('?')[0]
|
||||||
|
timelineBookmark=''
|
||||||
|
if '?bm=' in self.path:
|
||||||
|
timelineBookmark=self.path.split('?bm=')[1]
|
||||||
|
if '?' in timelineBookmark:
|
||||||
|
timelineBookmark=timelineBookmark.split('?')[0]
|
||||||
|
timelineBookmark='#'+timelineBookmark
|
||||||
if '?page=' in self.path:
|
if '?page=' in self.path:
|
||||||
pageNumberStr=self.path.split('?page=')[1]
|
pageNumberStr=self.path.split('?page=')[1]
|
||||||
if '?' in pageNumberStr:
|
if '?' in pageNumberStr:
|
||||||
|
@ -1558,7 +1564,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._postToOutboxThread(announceJson)
|
self._postToOutboxThread(announceJson)
|
||||||
self.server.GETbusy=False
|
self.server.GETbusy=False
|
||||||
self._redirect_headers(actor+'/'+timelineStr+'?page='+ \
|
self._redirect_headers(actor+'/'+timelineStr+'?page='+ \
|
||||||
str(pageNumber),cookie)
|
str(pageNumber)+ \
|
||||||
|
timelineBookmark,cookie)
|
||||||
return
|
return
|
||||||
|
|
||||||
self._benchmarkGETtimings(GETstartTime,GETtimings,32)
|
self._benchmarkGETtimings(GETstartTime,GETtimings,32)
|
||||||
|
@ -1569,6 +1576,12 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
repeatUrl=self.path.split('?unrepeat=')[1]
|
repeatUrl=self.path.split('?unrepeat=')[1]
|
||||||
if '?' in repeatUrl:
|
if '?' in repeatUrl:
|
||||||
repeatUrl=repeatUrl.split('?')[0]
|
repeatUrl=repeatUrl.split('?')[0]
|
||||||
|
timelineBookmark=''
|
||||||
|
if '?bm=' in self.path:
|
||||||
|
timelineBookmark=self.path.split('?bm=')[1]
|
||||||
|
if '?' in timelineBookmark:
|
||||||
|
timelineBookmark=timelineBookmark.split('?')[0]
|
||||||
|
timelineBookmark='#'+timelineBookmark
|
||||||
if '?page=' in self.path:
|
if '?page=' in self.path:
|
||||||
pageNumberStr=self.path.split('?page=')[1]
|
pageNumberStr=self.path.split('?page=')[1]
|
||||||
if '?' in pageNumberStr:
|
if '?' in pageNumberStr:
|
||||||
|
@ -1611,7 +1624,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._postToOutboxThread(newUndoAnnounce)
|
self._postToOutboxThread(newUndoAnnounce)
|
||||||
self.server.GETbusy=False
|
self.server.GETbusy=False
|
||||||
self._redirect_headers(actor+'/'+timelineStr+'?page='+ \
|
self._redirect_headers(actor+'/'+timelineStr+'?page='+ \
|
||||||
str(pageNumber),cookie)
|
str(pageNumber)+ \
|
||||||
|
timelineBookmark,cookie)
|
||||||
return
|
return
|
||||||
|
|
||||||
self._benchmarkGETtimings(GETstartTime,GETtimings,33)
|
self._benchmarkGETtimings(GETstartTime,GETtimings,33)
|
||||||
|
@ -1680,6 +1694,12 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
likeUrl=self.path.split('?like=')[1]
|
likeUrl=self.path.split('?like=')[1]
|
||||||
if '?' in likeUrl:
|
if '?' in likeUrl:
|
||||||
likeUrl=likeUrl.split('?')[0]
|
likeUrl=likeUrl.split('?')[0]
|
||||||
|
timelineBookmark=''
|
||||||
|
if '?bm=' in self.path:
|
||||||
|
timelineBookmark=self.path.split('?bm=')[1]
|
||||||
|
if '?' in timelineBookmark:
|
||||||
|
timelineBookmark=timelineBookmark.split('?')[0]
|
||||||
|
timelineBookmark='#'+timelineBookmark
|
||||||
actor=self.path.split('?like=')[0]
|
actor=self.path.split('?like=')[0]
|
||||||
if '?page=' in self.path:
|
if '?page=' in self.path:
|
||||||
pageNumberStr=self.path.split('?page=')[1]
|
pageNumberStr=self.path.split('?page=')[1]
|
||||||
|
@ -1698,7 +1718,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
print('WARN: unable to find nickname in '+actor)
|
print('WARN: unable to find nickname in '+actor)
|
||||||
self.server.GETbusy=False
|
self.server.GETbusy=False
|
||||||
self._redirect_headers(actor+'/'+timelineStr+ \
|
self._redirect_headers(actor+'/'+timelineStr+ \
|
||||||
'?page='+str(pageNumber),cookie)
|
'?page='+str(pageNumber)+ \
|
||||||
|
timelineBookmark,cookie)
|
||||||
return
|
return
|
||||||
if not self.server.session:
|
if not self.server.session:
|
||||||
self.server.session= \
|
self.server.session= \
|
||||||
|
@ -1719,7 +1740,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._postToOutbox(likeJson,self.server.projectVersion)
|
self._postToOutbox(likeJson,self.server.projectVersion)
|
||||||
self.server.GETbusy=False
|
self.server.GETbusy=False
|
||||||
self._redirect_headers(actor+'/'+timelineStr+ \
|
self._redirect_headers(actor+'/'+timelineStr+ \
|
||||||
'?page='+str(pageNumber),cookie)
|
'?page='+str(pageNumber)+ \
|
||||||
|
timelineBookmark,cookie)
|
||||||
return
|
return
|
||||||
|
|
||||||
self._benchmarkGETtimings(GETstartTime,GETtimings,36)
|
self._benchmarkGETtimings(GETstartTime,GETtimings,36)
|
||||||
|
@ -1730,6 +1752,12 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
likeUrl=self.path.split('?unlike=')[1]
|
likeUrl=self.path.split('?unlike=')[1]
|
||||||
if '?' in likeUrl:
|
if '?' in likeUrl:
|
||||||
likeUrl=likeUrl.split('?')[0]
|
likeUrl=likeUrl.split('?')[0]
|
||||||
|
timelineBookmark=''
|
||||||
|
if '?bm=' in self.path:
|
||||||
|
timelineBookmark=self.path.split('?bm=')[1]
|
||||||
|
if '?' in timelineBookmark:
|
||||||
|
timelineBookmark=timelineBookmark.split('?')[0]
|
||||||
|
timelineBookmark='#'+timelineBookmark
|
||||||
if '?page=' in self.path:
|
if '?page=' in self.path:
|
||||||
pageNumberStr=self.path.split('?page=')[1]
|
pageNumberStr=self.path.split('?page=')[1]
|
||||||
if '?' in pageNumberStr:
|
if '?' in pageNumberStr:
|
||||||
|
@ -1773,7 +1801,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._postToOutbox(undoLikeJson,self.server.projectVersion)
|
self._postToOutbox(undoLikeJson,self.server.projectVersion)
|
||||||
self.server.GETbusy=False
|
self.server.GETbusy=False
|
||||||
self._redirect_headers(actor+'/'+timelineStr+ \
|
self._redirect_headers(actor+'/'+timelineStr+ \
|
||||||
'?page='+str(pageNumber),cookie)
|
'?page='+str(pageNumber)+ \
|
||||||
|
timelineBookmark,cookie)
|
||||||
return
|
return
|
||||||
|
|
||||||
self._benchmarkGETtimings(GETstartTime,GETtimings,36)
|
self._benchmarkGETtimings(GETstartTime,GETtimings,36)
|
||||||
|
@ -1784,6 +1813,12 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
bookmarkUrl=self.path.split('?bookmark=')[1]
|
bookmarkUrl=self.path.split('?bookmark=')[1]
|
||||||
if '?' in bookmarkUrl:
|
if '?' in bookmarkUrl:
|
||||||
bookmarkUrl=bookmarkUrl.split('?')[0]
|
bookmarkUrl=bookmarkUrl.split('?')[0]
|
||||||
|
timelineBookmark=''
|
||||||
|
if '?bm=' in self.path:
|
||||||
|
timelineBookmark=self.path.split('?bm=')[1]
|
||||||
|
if '?' in timelineBookmark:
|
||||||
|
timelineBookmark=timelineBookmark.split('?')[0]
|
||||||
|
timelineBookmark='#'+timelineBookmark
|
||||||
actor=self.path.split('?bookmark=')[0]
|
actor=self.path.split('?bookmark=')[0]
|
||||||
if '?page=' in self.path:
|
if '?page=' in self.path:
|
||||||
pageNumberStr=self.path.split('?page=')[1]
|
pageNumberStr=self.path.split('?page=')[1]
|
||||||
|
@ -1820,7 +1855,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._postToOutbox(bookmarkJson,self.server.projectVersion)
|
self._postToOutbox(bookmarkJson,self.server.projectVersion)
|
||||||
self.server.GETbusy=False
|
self.server.GETbusy=False
|
||||||
self._redirect_headers(actor+'/'+timelineStr+ \
|
self._redirect_headers(actor+'/'+timelineStr+ \
|
||||||
'?page='+str(pageNumber),cookie)
|
'?page='+str(pageNumber)+ \
|
||||||
|
timelineBookmark,cookie)
|
||||||
return
|
return
|
||||||
|
|
||||||
# undo a bookmark from the web interface icon
|
# undo a bookmark from the web interface icon
|
||||||
|
@ -1829,6 +1865,12 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
bookmarkUrl=self.path.split('?unbookmark=')[1]
|
bookmarkUrl=self.path.split('?unbookmark=')[1]
|
||||||
if '?' in bookmarkUrl:
|
if '?' in bookmarkUrl:
|
||||||
bookmarkUrl=bookmarkUrl.split('?')[0]
|
bookmarkUrl=bookmarkUrl.split('?')[0]
|
||||||
|
timelineBookmark=''
|
||||||
|
if '?bm=' in self.path:
|
||||||
|
timelineBookmark=self.path.split('?bm=')[1]
|
||||||
|
if '?' in timelineBookmark:
|
||||||
|
timelineBookmark=timelineBookmark.split('?')[0]
|
||||||
|
timelineBookmark='#'+timelineBookmark
|
||||||
if '?page=' in self.path:
|
if '?page=' in self.path:
|
||||||
pageNumberStr=self.path.split('?page=')[1]
|
pageNumberStr=self.path.split('?page=')[1]
|
||||||
if '?' in pageNumberStr:
|
if '?' in pageNumberStr:
|
||||||
|
@ -1869,7 +1911,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self._postToOutbox(undoBookmarkJson,self.server.projectVersion)
|
self._postToOutbox(undoBookmarkJson,self.server.projectVersion)
|
||||||
self.server.GETbusy=False
|
self.server.GETbusy=False
|
||||||
self._redirect_headers(actor+'/'+timelineStr+ \
|
self._redirect_headers(actor+'/'+timelineStr+ \
|
||||||
'?page='+str(pageNumber),cookie)
|
'?page='+str(pageNumber)+ \
|
||||||
|
timelineBookmark,cookie)
|
||||||
return
|
return
|
||||||
|
|
||||||
self._benchmarkGETtimings(GETstartTime,GETtimings,37)
|
self._benchmarkGETtimings(GETstartTime,GETtimings,37)
|
||||||
|
|
|
@ -1869,11 +1869,10 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
|
||||||
session,wfRequest: {},personCache: {}, \
|
session,wfRequest: {},personCache: {}, \
|
||||||
nickname: str,domain: str,port: int, \
|
nickname: str,domain: str,port: int, \
|
||||||
postJsonObject: {}, \
|
postJsonObject: {}, \
|
||||||
avatarUrl: str, showAvatarOptions: bool,
|
avatarUrl: str,showAvatarOptions: bool,
|
||||||
allowDeletion: bool, \
|
allowDeletion: bool, \
|
||||||
httpPrefix: str, projectVersion: str, \
|
httpPrefix: str,projectVersion: str, \
|
||||||
boxName: str, \
|
boxName: str,showRepeats=True, \
|
||||||
showRepeats=True, \
|
|
||||||
showIcons=False, \
|
showIcons=False, \
|
||||||
manuallyApprovesFollowers=False, \
|
manuallyApprovesFollowers=False, \
|
||||||
showPublicOnly=False,
|
showPublicOnly=False,
|
||||||
|
@ -1906,6 +1905,8 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
|
||||||
if boxName=='tlbookmarks':
|
if boxName=='tlbookmarks':
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
timelinePostBookmark=postJsonObject['id'].replace('/activity','').replace('://','-').replace('/','-')
|
||||||
|
|
||||||
# If this is the inbox timeline then don't show the repeat icon on any DMs
|
# If this is the inbox timeline then don't show the repeat icon on any DMs
|
||||||
showRepeatIcon=showRepeats
|
showRepeatIcon=showRepeats
|
||||||
showDMicon=False
|
showDMicon=False
|
||||||
|
@ -2202,6 +2203,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
|
||||||
announceStr= \
|
announceStr= \
|
||||||
'<a href="/users/'+nickname+'?'+announceLink+'='+postJsonObject['object']['id']+pageNumberParam+ \
|
'<a href="/users/'+nickname+'?'+announceLink+'='+postJsonObject['object']['id']+pageNumberParam+ \
|
||||||
'?actor='+postJsonObject['actor']+ \
|
'?actor='+postJsonObject['actor']+ \
|
||||||
|
'?bm='+timelinePostBookmark+ \
|
||||||
'?tl='+boxName+'" title="'+announceTitle+'">'
|
'?tl='+boxName+'" title="'+announceTitle+'">'
|
||||||
announceStr+='<img loading="lazy" src="/'+iconsDir+'/'+announceIcon+'"/></a>'
|
announceStr+='<img loading="lazy" src="/'+iconsDir+'/'+announceIcon+'"/></a>'
|
||||||
|
|
||||||
|
@ -2219,6 +2221,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
|
||||||
'<a href="/users/' + nickname + '?' + \
|
'<a href="/users/' + nickname + '?' + \
|
||||||
likeLink + '=' + postJsonObject['object']['id'] + pageNumberParam + \
|
likeLink + '=' + postJsonObject['object']['id'] + pageNumberParam + \
|
||||||
'?actor='+postJsonObject['actor']+ \
|
'?actor='+postJsonObject['actor']+ \
|
||||||
|
'?bm='+timelinePostBookmark+ \
|
||||||
'?tl='+boxName+'" title="'+likeTitle+'">'
|
'?tl='+boxName+'" title="'+likeTitle+'">'
|
||||||
likeStr+='<img loading="lazy" src="/'+iconsDir+'/'+likeIcon+'"/></a>'
|
likeStr+='<img loading="lazy" src="/'+iconsDir+'/'+likeIcon+'"/></a>'
|
||||||
|
|
||||||
|
@ -2321,7 +2324,7 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
|
||||||
|
|
||||||
postHtml=''
|
postHtml=''
|
||||||
if boxName!='tlmedia':
|
if boxName!='tlmedia':
|
||||||
postHtml='<div class="'+containerClass+'">\n'
|
postHtml='<div id="'+timelinePostBookmark+'" class="'+containerClass+'">\n'
|
||||||
postHtml+=avatarImageInPost
|
postHtml+=avatarImageInPost
|
||||||
postHtml+='<p class="post-title">'+titleStr+replyAvatarImageInPost+'</p>'
|
postHtml+='<p class="post-title">'+titleStr+replyAvatarImageInPost+'</p>'
|
||||||
postHtml+=contentStr+footerStr
|
postHtml+=contentStr+footerStr
|
||||||
|
|
Loading…
Reference in New Issue