From 4fe227f5a04e1c73cd4607686053fe49635d898f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 6 Dec 2020 23:35:21 +0000 Subject: [PATCH] Handle single parameter case for replies --- daemon.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/daemon.py b/daemon.py index 7776c3b0b..477d6f7a4 100644 --- a/daemon.py +++ b/daemon.py @@ -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)