From 877fb079f34f10c857c42cd04ffd0b5e0cd4ca69 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 11 Apr 2024 05:12:13 +0200 Subject: mastoapi: 'unfavourite' and 'unreblog' actions now fully work. --- mastoapi.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'mastoapi.c') diff --git a/mastoapi.c b/mastoapi.c index fab71f1..4d80f69 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -2314,11 +2314,13 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, } else if (strcmp(op, "unfavourite") == 0) { /** **/ - /* partial support: as the original Like message - is not stored anywhere here, it's not possible - to send an Undo + Like; the only thing done here - is to delete the actor from the list of likes */ - object_unadmire(id, snac.actor, 1); + xs *n_msg = msg_repulsion(&snac, id, "Like"); + + if (n_msg != NULL) { + enqueue_message(&snac, n_msg); + + out = mastoapi_status(&snac, msg); + } } else if (strcmp(op, "reblog") == 0) { /** **/ @@ -2333,8 +2335,13 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, } else if (strcmp(op, "unreblog") == 0) { /** **/ - /* partial support: see comment in 'unfavourite' */ - object_unadmire(id, snac.actor, 0); + xs *n_msg = msg_repulsion(&snac, id, "Announce"); + + if (n_msg != NULL) { + enqueue_message(&snac, n_msg); + + out = mastoapi_status(&snac, msg); + } } else if (strcmp(op, "bookmark") == 0) { /** **/ -- cgit v1.2.3