summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authorGravatar default2024-04-11 05:12:13 +0200
committerGravatar default2024-04-11 05:12:13 +0200
commit877fb079f34f10c857c42cd04ffd0b5e0cd4ca69 (patch)
tree356ff30c1bacb5850fcdb11b31935258bbcc856b /mastoapi.c
parentNew function msg_repulsion. (diff)
downloadsnac2-877fb079f34f10c857c42cd04ffd0b5e0cd4ca69.tar.gz
snac2-877fb079f34f10c857c42cd04ffd0b5e0cd4ca69.tar.xz
snac2-877fb079f34f10c857c42cd04ffd0b5e0cd4ca69.zip
mastoapi: 'unfavourite' and 'unreblog' actions now fully work.
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c21
1 files changed, 14 insertions, 7 deletions
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,
2314 } 2314 }
2315 else 2315 else
2316 if (strcmp(op, "unfavourite") == 0) { /** **/ 2316 if (strcmp(op, "unfavourite") == 0) { /** **/
2317 /* partial support: as the original Like message 2317 xs *n_msg = msg_repulsion(&snac, id, "Like");
2318 is not stored anywhere here, it's not possible 2318
2319 to send an Undo + Like; the only thing done here 2319 if (n_msg != NULL) {
2320 is to delete the actor from the list of likes */ 2320 enqueue_message(&snac, n_msg);
2321 object_unadmire(id, snac.actor, 1); 2321
2322 out = mastoapi_status(&snac, msg);
2323 }
2322 } 2324 }
2323 else 2325 else
2324 if (strcmp(op, "reblog") == 0) { /** **/ 2326 if (strcmp(op, "reblog") == 0) { /** **/
@@ -2333,8 +2335,13 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
2333 } 2335 }
2334 else 2336 else
2335 if (strcmp(op, "unreblog") == 0) { /** **/ 2337 if (strcmp(op, "unreblog") == 0) { /** **/
2336 /* partial support: see comment in 'unfavourite' */ 2338 xs *n_msg = msg_repulsion(&snac, id, "Announce");
2337 object_unadmire(id, snac.actor, 0); 2339
2340 if (n_msg != NULL) {
2341 enqueue_message(&snac, n_msg);
2342
2343 out = mastoapi_status(&snac, msg);
2344 }
2338 } 2345 }
2339 else 2346 else
2340 if (strcmp(op, "bookmark") == 0) { /** **/ 2347 if (strcmp(op, "bookmark") == 0) { /** **/