mirror of https://gitlab.com/bashrc2/epicyon
Construct actor
parent
f0580d8306
commit
82122fefbd
|
@ -2509,7 +2509,10 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
sharedItemsStr= \
|
sharedItemsStr= \
|
||||||
htmlSearchSharedItems(self.server.baseDir, \
|
htmlSearchSharedItems(self.server.baseDir, \
|
||||||
searchStr,pageNumber, \
|
searchStr,pageNumber, \
|
||||||
maxPostsInFeed,actorStr)
|
maxPostsInFeed, \
|
||||||
|
self.server.httpPrefix, \
|
||||||
|
self.server.domainFull, \
|
||||||
|
actorStr)
|
||||||
if sharedItemsStr:
|
if sharedItemsStr:
|
||||||
msg=sharedItemsStr.encode('utf-8')
|
msg=sharedItemsStr.encode('utf-8')
|
||||||
self._login_headers('text/html',len(msg))
|
self._login_headers('text/html',len(msg))
|
||||||
|
|
|
@ -94,16 +94,15 @@ def htmlSearchEmoji(baseDir: str,searchStr: str) -> str:
|
||||||
emojiForm+=htmlFooter()
|
emojiForm+=htmlFooter()
|
||||||
return emojiForm
|
return emojiForm
|
||||||
|
|
||||||
def htmlSearchSharedItems(baseDir: str,searchStr: str,pageNumber: int,resultsPerPage: int,actor: str) -> str:
|
def htmlSearchSharedItems(baseDir: str,searchStr: str, \
|
||||||
|
pageNumber: int, \
|
||||||
|
resultsPerPage: int, \
|
||||||
|
httpPrefix: str,domainFull: str,actor: str) -> str:
|
||||||
"""Search results for shared items
|
"""Search results for shared items
|
||||||
"""
|
"""
|
||||||
currPage=1
|
currPage=1
|
||||||
ctr=0
|
ctr=0
|
||||||
actorDomain,actorPort=getDomainFromActor(actor)
|
actor=httpPrefix+'://'+domainFull+actor
|
||||||
if actorPort:
|
|
||||||
if actorPort!=80 and actorPort!=443:
|
|
||||||
actorDomain=actorDomain+':'+str(actorPort)
|
|
||||||
actorHttpPrefix=actor.split('://')[0]
|
|
||||||
sharedItemsForm=''
|
sharedItemsForm=''
|
||||||
searchStrLower=searchStr.replace('%2B','+').replace('%40','@').replace('%3A',':').replace('%23','#').lower().strip('\n')
|
searchStrLower=searchStr.replace('%2B','+').replace('%40','@').replace('%3A',':').replace('%23','#').lower().strip('\n')
|
||||||
searchStrLowerList=searchStrLower.split('+')
|
searchStrLowerList=searchStrLower.split('+')
|
||||||
|
@ -149,7 +148,7 @@ def htmlSearchSharedItems(baseDir: str,searchStr: str,pageNumber: int,resultsPer
|
||||||
sharedItemsForm+='<p><b>Type:</b> '+sharedItem['itemType']+' '
|
sharedItemsForm+='<p><b>Type:</b> '+sharedItem['itemType']+' '
|
||||||
sharedItemsForm+='<b>Category:</b> '+sharedItem['category']+' '
|
sharedItemsForm+='<b>Category:</b> '+sharedItem['category']+' '
|
||||||
sharedItemsForm+='<b>Location:</b> '+sharedItem['location']+'</p>'
|
sharedItemsForm+='<b>Location:</b> '+sharedItem['location']+'</p>'
|
||||||
contactActor=actorHttpPrefix+'://'+actorDomain+'/users/'+contactNickname
|
contactActor=httpPrefix+'://'+domainFull+'/users/'+contactNickname
|
||||||
sharedItemsForm+='<p><a href="'+actor+'?replydm='+sharedItem['displayName']+'?mention='+contactActor+'">Contact</a>'
|
sharedItemsForm+='<p><a href="'+actor+'?replydm='+sharedItem['displayName']+'?mention='+contactActor+'">Contact</a>'
|
||||||
sharedItemsForm+='</div>'
|
sharedItemsForm+='</div>'
|
||||||
if not resultsExist and currPage>1:
|
if not resultsExist and currPage>1:
|
||||||
|
|
Loading…
Reference in New Issue