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