summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--activitypub.c6
-rw-r--r--mastoapi.c21
2 files changed, 17 insertions, 10 deletions
diff --git a/activitypub.c b/activitypub.c
index afbe7af..9a23e14 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1186,11 +1186,11 @@ xs_dict *msg_repulsion(snac *user, char *id, char *type)
1186 1186
1187 /* copy the 'to' field */ 1187 /* copy the 'to' field */
1188 msg = xs_dict_set(msg, "to", xs_dict_get(object, "to")); 1188 msg = xs_dict_set(msg, "to", xs_dict_get(object, "to"));
1189
1190 /* now we despise this */
1191 object_unadmire(id, user->actor, *type == 'L' ? 1 : 0);
1192 } 1189 }
1193 1190
1191 /* now we despise this */
1192 object_unadmire(id, user->actor, *type == 'L' ? 1 : 0);
1193
1194 return msg; 1194 return msg;
1195} 1195}
1196 1196
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) { /** **/