diff --git a/desktop_client.py b/desktop_client.py index 719280451..37488daa4 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -236,7 +236,7 @@ def _newDesktopNotifications(actor: str, inboxJson: {}, notifyJson['dmNotify'] = True notifyJson['dmNotifyChanged'] = True notifyJson['dmPostId'] = postJsonObject['id'] - DMdone = True + DMdone = True else: if not replyDone: if not _hasReadPost(actor, postJsonObject['id'], 'replies'): @@ -250,7 +250,7 @@ def _newDesktopNotifications(actor: str, inboxJson: {}, notifyJson['repliesNotify'] = True notifyJson['repliesNotifyChanged'] = True notifyJson['repliesPostId'] = postJsonObject['id'] - replyDone = True + replyDone = True def _desktopClearScreen() -> None: @@ -625,9 +625,7 @@ def _showRepliesOnPost(postJsonObject: {}, maxReplies: int) -> None: return print('') ctr = 0 - print('Test 4638653 ' + str(postJsonObject['object']['replies']['items'])) for item in postJsonObject['object']['replies']['items']: - print('Test 768235 ' + str(item)) print(' ↰ ' + str(item['url'])) ctr += 1 if ctr >= maxReplies: diff --git a/inbox.py b/inbox.py index 670275283..177c533e1 100644 --- a/inbox.py +++ b/inbox.py @@ -1593,12 +1593,32 @@ def populateReplies(baseDir: str, httpPrefix: str, domain: str, if debug: print('DEBUG: no domain found for ' + replyTo) return False + postFilename = locatePost(baseDir, replyToNickname, replyToDomain, replyTo) if not postFilename: if debug: print('DEBUG: post may have expired - ' + replyTo) return False + +# TODO store replies collection +# replyItem = { +# "type": "Document", +# "url": replyTo +# } +# if not messageJson['object'].get('replies'): +# messageJson['object']['replies'] = { +# "items": [replyItem] +# } +# else: +# found = False +# for item in messageJson['object']['replies']['items']: +# if item['url'] == replyTo: +# found = True +# break +# if not found: +# messageJson['object']['replies']['items'].append(replyItem) +# if not _postAllowsComments(postFilename): if debug: print('DEBUG: post does not allow comments - ' + replyTo)