Handle single parameter case for replies

merge-requests/8/head
Bob Mottram 2020-12-06 23:35:21 +00:00
parent 113a0a3c9e
commit 4fe227f5a0
1 changed files with 16 additions and 3 deletions

View File

@ -10538,7 +10538,9 @@ class PubServer(BaseHTTPRequestHandler):
# for moderation posts or the dm timeline
if '?replydm=' in self.path:
inReplyToUrl = self.path.split('?replydm=')[1]
inReplyToUrl = urllib.parse.unquote_plus(inReplyToUrl)
if '?' in inReplyToUrl:
# multiple parameters
mentionsList = inReplyToUrl.split('?')
for m in mentionsList:
if m.startswith('mention='):
@ -10554,12 +10556,23 @@ class PubServer(BaseHTTPRequestHandler):
# get the title for the shared item
shareDescription = \
m.replace('sharedesc:', '').strip()
shareDescription = \
urllib.parse.unquote_plus(shareDescription)
shareDescription = \
shareDescription.replace('_', ' ')
else:
# single parameter
if inReplyToUrl.startswith('mention='):
replyHandle = inReplyToUrl.replace('mention=', '')
inReplyToUrl = replyHandle
if replyHandle not in replyToList:
replyToList.append(replyHandle)
elif inReplyToUrl.startswith('sharedesc:'):
# get the title for the shared item
shareDescription = \
inReplyToUrl.replace('sharedesc:', '').strip()
shareDescription = \
shareDescription.replace('_', ' ')
self.path = self.path.split('?replydm=')[0]+'/newdm'
self.path = self.path.split('?replydm=')[0] + '/newdm'
if self.server.debug:
print('DEBUG: replydm path ' + self.path)