diff --git a/bookmarks.py b/bookmarks.py index f696c1d7c..7e178d7a6 100644 --- a/bookmarks.py +++ b/bookmarks.py @@ -534,9 +534,13 @@ def outboxBookmark(recentPostsCache: {}, if debug: print('DEBUG: no target in bookmark Add') return - if not isinstance(messageJson['object'], str): + if not isinstance(messageJson['object'], dict): if debug: - print('DEBUG: bookmark Add object is not string') + print('DEBUG: bookmark Add object is not dict') + return + if not messageJson['object'].get('type'): + if debug: + print('DEBUG: no object type in bookmark Add') return if not isinstance(messageJson['target'], str): if debug: @@ -599,9 +603,13 @@ def outboxUndoBookmark(recentPostsCache: {}, if debug: print('DEBUG: no target in unbookmark Remove') return - if not isinstance(messageJson['object'], str): + if not isinstance(messageJson['object'], dict): if debug: - print('DEBUG: unbookmark Remove object is not string') + print('DEBUG: unbookmark Remove object is not dict') + return + if not messageJson['object'].get('type'): + if debug: + print('DEBUG: no object type in bookmark Remove') return if not isinstance(messageJson['target'], str): if debug: diff --git a/inbox.py b/inbox.py index 84241a80b..bef4561d5 100644 --- a/inbox.py +++ b/inbox.py @@ -1098,10 +1098,14 @@ def _receiveBookmark(recentPostsCache: {}, if debug: print('DEBUG: no target in inbox bookmark Add') return False - if not isinstance(messageJson['object'], str): + if not isinstance(messageJson['object'], dict): if debug: print('DEBUG: inbox bookmark Add object is not string') return False + if not messageJson['object'].get('type'): + if debug: + print('DEBUG: no object type in inbox bookmark Add') + return False if not isinstance(messageJson['target'], str): if debug: print('DEBUG: inbox bookmark Add target is not string') @@ -1173,13 +1177,17 @@ def _receiveUndoBookmark(recentPostsCache: {}, if debug: print('DEBUG: no target in inbox undo bookmark Remove') return False - if not isinstance(messageJson['object'], str): + if not isinstance(messageJson['object'], dict): if debug: - print('DEBUG: inbox undo bookmark Remove object is not string') + print('DEBUG: inbox Remove bookmark object is not dict') + return False + if not messageJson['object'].get('type'): + if debug: + print('DEBUG: no object type in inbox bookmark Remove') return False if not isinstance(messageJson['target'], str): if debug: - print('DEBUG: inbox undo bookmark Remove target is not string') + print('DEBUG: inbox Remove bookmark target is not string') return False domainFull = getFullDomain(domain, port) nickname = handle.split('@')[0]