To not within object

main
Bob Mottram 2019-11-17 14:39:53 +00:00
parent 3bb0ef5b27
commit da3e798d95
1 changed files with 8 additions and 8 deletions

View File

@ -583,13 +583,13 @@ def outboxBookmark(baseDir: str,httpPrefix: str, \
if debug: if debug:
print('DEBUG: bookmark object is not string') print('DEBUG: bookmark object is not string')
return return
if messageJson['object'].get('to'): if messageJson.get('to'):
if not isinstance(messageJson['object']['to'], list): if not isinstance(messageJson['to'], list):
return return
if len(messageJson['object']['to'])!=1: if len(messageJson['to'])!=1:
print('WARN: Bookmark should only be sent to one recipient') print('WARN: Bookmark should only be sent to one recipient')
return return
if messageJson['object']['to'][0]!=messageJson['actor']: if messageJson['to'][0]!=messageJson['actor']:
print('WARN: Bookmark should be addressed to the same actor') print('WARN: Bookmark should be addressed to the same actor')
return return
if debug: if debug:
@ -640,13 +640,13 @@ def outboxUndoBookmark(baseDir: str,httpPrefix: str, \
if debug: if debug:
print('DEBUG: undo bookmark object is not string') print('DEBUG: undo bookmark object is not string')
return return
if messageJson['object'].get('to'): if messageJson.get('to'):
if not isinstance(messageJson['object']['to'], list): if not isinstance(messageJson['to'], list):
return return
if len(messageJson['object']['to'])!=1: if len(messageJson['to'])!=1:
print('WARN: Bookmark should only be sent to one recipient') print('WARN: Bookmark should only be sent to one recipient')
return return
if messageJson['object']['to'][0]!=messageJson['actor']: if messageJson['to'][0]!=messageJson['actor']:
print('WARN: Bookmark should be addressed to the same actor') print('WARN: Bookmark should be addressed to the same actor')
return return
if debug: if debug: