diff --git a/inbox.py b/inbox.py index 56f30dbd..00eaea79 100644 --- a/inbox.py +++ b/inbox.py @@ -625,6 +625,13 @@ def receiveUndoAnnounce(session,handle: str,baseDir: str, \ return True if debug: print('DEBUG: announced/repeated post to be undone found in inbox') + with open(postFilename, 'r') as fp: + postJson=commentjson.load(fp) + if not postJson.get('type'): + if postJson['type']!='Announce': + if debug: + print("DEBUG: Attenpt to undo something which isn't an announcement") + return False os.remove(postFilename) return True diff --git a/like.py b/like.py index dc5fb146..f6719128 100644 --- a/like.py +++ b/like.py @@ -21,7 +21,7 @@ def undoLikesCollectionEntry(postFilename: str,objectUrl: str, actor: str,debug: with open(postFilename, 'r') as fp: postJson=commentjson.load(fp) if not postJson.get('type'): - if not postJson['type']=='Create': + if postJson['type']!='Create': return return if not postJson.get('object'):