mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-02 16:21:32 -08:00
apf part 30: Announce / Undo / Like or Dislike
This commit is contained in:
parent
4c4fddba80
commit
381c4a8837
1 changed files with 10 additions and 0 deletions
|
@ -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 --
|
||||
|
|
Loading…
Add table
Reference in a new issue