From 432b5ef643d1877e34e41d9d5dabfd6c177a444f Mon Sep 17 00:00:00 2001
From: Bob Mottram
Date: Sun, 25 Aug 2019 23:12:47 +0100
Subject: [PATCH] Include description of share in reply
---
daemon.py | 5 ++++-
webinterface.py | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/daemon.py b/daemon.py
index 252d20ec8..66a5517b4 100644
--- a/daemon.py
+++ b/daemon.py
@@ -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
diff --git a/webinterface.py b/webinterface.py
index 7b6b0851c..787c80a46 100644
--- a/webinterface.py
+++ b/webinterface.py
@@ -149,7 +149,7 @@ def htmlSearchSharedItems(baseDir: str,searchStr: str, \
sharedItemsForm+='Category: '+sharedItem['category']+' '
sharedItemsForm+='Location: '+sharedItem['location']+'
'
contactActor=httpPrefix+'://'+domainFull+'/users/'+contactNickname
- sharedItemsForm+='Contact'
+ sharedItemsForm+='
Contact'
sharedItemsForm+=''
if not resultsExist and currPage>1:
# previous page link, needs to be a POST