Done earlier

main
Bob Mottram 2021-03-23 22:52:00 +00:00
parent 5f24d6cda4
commit ebb2453542
2 changed files with 22 additions and 4 deletions

View File

@ -236,7 +236,7 @@ def _newDesktopNotifications(actor: str, inboxJson: {},
notifyJson['dmNotify'] = True notifyJson['dmNotify'] = True
notifyJson['dmNotifyChanged'] = True notifyJson['dmNotifyChanged'] = True
notifyJson['dmPostId'] = postJsonObject['id'] notifyJson['dmPostId'] = postJsonObject['id']
DMdone = True DMdone = True
else: else:
if not replyDone: if not replyDone:
if not _hasReadPost(actor, postJsonObject['id'], 'replies'): if not _hasReadPost(actor, postJsonObject['id'], 'replies'):
@ -250,7 +250,7 @@ def _newDesktopNotifications(actor: str, inboxJson: {},
notifyJson['repliesNotify'] = True notifyJson['repliesNotify'] = True
notifyJson['repliesNotifyChanged'] = True notifyJson['repliesNotifyChanged'] = True
notifyJson['repliesPostId'] = postJsonObject['id'] notifyJson['repliesPostId'] = postJsonObject['id']
replyDone = True replyDone = True
def _desktopClearScreen() -> None: def _desktopClearScreen() -> None:
@ -625,9 +625,7 @@ def _showRepliesOnPost(postJsonObject: {}, maxReplies: int) -> None:
return return
print('') print('')
ctr = 0 ctr = 0
print('Test 4638653 ' + str(postJsonObject['object']['replies']['items']))
for item in postJsonObject['object']['replies']['items']: for item in postJsonObject['object']['replies']['items']:
print('Test 768235 ' + str(item))
print('' + str(item['url'])) print('' + str(item['url']))
ctr += 1 ctr += 1
if ctr >= maxReplies: if ctr >= maxReplies:

View File

@ -1593,12 +1593,32 @@ def populateReplies(baseDir: str, httpPrefix: str, domain: str,
if debug: if debug:
print('DEBUG: no domain found for ' + replyTo) print('DEBUG: no domain found for ' + replyTo)
return False return False
postFilename = locatePost(baseDir, replyToNickname, postFilename = locatePost(baseDir, replyToNickname,
replyToDomain, replyTo) replyToDomain, replyTo)
if not postFilename: if not postFilename:
if debug: if debug:
print('DEBUG: post may have expired - ' + replyTo) print('DEBUG: post may have expired - ' + replyTo)
return False 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 not _postAllowsComments(postFilename):
if debug: if debug:
print('DEBUG: post does not allow comments - ' + replyTo) print('DEBUG: post does not allow comments - ' + replyTo)