Include description of share in reply

master
Bob Mottram 2019-08-25 23:12:47 +01:00
parent adfd4091fd
commit 432b5ef643
2 changed files with 5 additions and 2 deletions

View File

@ -1030,6 +1030,7 @@ class PubServer(BaseHTTPRequestHandler):
print('DEBUG: replyto path '+self.path)
# replying as a direct message, for moderation posts
shareDescription=None
if htmlGET and '?replydm=' in self.path:
inReplyToUrl=self.path.split('?replydm=')[1]
if '?' in inReplyToUrl:
@ -1038,6 +1039,8 @@ class PubServer(BaseHTTPRequestHandler):
if m.startswith('mention='):
replyToList.append(m.replace('mention=',''))
inReplyToUrl=mentionsList[0]
if inReplyToUrl.startswith('share:'):
shareDescription=inReplyToUrl
self.path=self.path.split('?replydm=')[0]+'/newdm'
if self.server.debug:
print('DEBUG: replydm path '+self.path)
@ -1058,7 +1061,7 @@ class PubServer(BaseHTTPRequestHandler):
self.path.endswith('/newdm') or \
self.path.endswith('/newreport') or \
self.path.endswith('/newshare')):
msg=htmlNewPost(self.server.baseDir,self.path,inReplyToUrl,replyToList,None).encode()
msg=htmlNewPost(self.server.baseDir,self.path,inReplyToUrl,replyToList,shareDescription).encode()
self._set_headers('text/html',len(msg),cookie)
self.wfile.write(msg)
self.server.GETbusy=False

View File

@ -149,7 +149,7 @@ def htmlSearchSharedItems(baseDir: str,searchStr: str, \
sharedItemsForm+='<b>Category:</b> '+sharedItem['category']+' '
sharedItemsForm+='<b>Location:</b> '+sharedItem['location']+'</p>'
contactActor=httpPrefix+'://'+domainFull+'/users/'+contactNickname
sharedItemsForm+='<p><a href="'+actor+'?replydm='+sharedItem['displayName']+'?mention='+contactActor+'">Contact</a>'
sharedItemsForm+='<p><a href="'+actor+'?replydm=share:'+sharedItem['displayName']+'?mention='+contactActor+'">Contact</a>'
sharedItemsForm+='</div>'
if not resultsExist and currPage>1:
# previous page link, needs to be a POST