apf part 30: Announce / Undo / Like or Dislike

This commit is contained in:
freamon 2024-11-24 21:19:07 +00:00
parent 4c4fddba80
commit 381c4a8837

View file

@ -1060,6 +1060,16 @@ def process_inbox_request(request_json, store_ap_json):
log_incoming_ap(request_json['id'], APLOG_UNDO_DELETE, APLOG_FAILURE, request_json if store_ap_json else None, 'Undo delete: cannot find ' + ap_id)
return
if request_json['object']['object']['type'] == 'Like' or request_json['object']['object']['type'] == 'Dislike': # Announce of undo of upvote or downvote
post = comment = None
target_ap_id = request_json['object']['object']['object']
post_or_comment = undo_vote(comment, post, target_ap_id, user)
if post_or_comment:
log_incoming_ap(request_json['id'], APLOG_UNDO_VOTE, APLOG_SUCCESS, request_json if store_ap_json else None)
else:
log_incoming_ap(request_json['id'], APLOG_UNDO_VOTE, APLOG_FAILURE, request_json if store_ap_json else None, 'Unfound object ' + target_ap_id)
return
# -- below this point is code that will be incrementally replaced to use log_incoming_ap() instead --