forked from indymedia/epicyon
Check that the unannounced post is an announce
parent
dec34f9941
commit
050f2f5484
7
inbox.py
7
inbox.py
|
@ -625,6 +625,13 @@ def receiveUndoAnnounce(session,handle: str,baseDir: str, \
|
||||||
return True
|
return True
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: announced/repeated post to be undone found in inbox')
|
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)
|
os.remove(postFilename)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
2
like.py
2
like.py
|
@ -21,7 +21,7 @@ def undoLikesCollectionEntry(postFilename: str,objectUrl: str, actor: str,debug:
|
||||||
with open(postFilename, 'r') as fp:
|
with open(postFilename, 'r') as fp:
|
||||||
postJson=commentjson.load(fp)
|
postJson=commentjson.load(fp)
|
||||||
if not postJson.get('type'):
|
if not postJson.get('type'):
|
||||||
if not postJson['type']=='Create':
|
if postJson['type']!='Create':
|
||||||
return
|
return
|
||||||
return
|
return
|
||||||
if not postJson.get('object'):
|
if not postJson.get('object'):
|
||||||
|
|
Loading…
Reference in New Issue