mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-10 03:50:38 +03:00
mastoapi: 'unfavourite' and 'unreblog' actions now fully work.
This commit is contained in:
parent
1a6bb79921
commit
877fb079f3
@ -1186,10 +1186,10 @@ xs_dict *msg_repulsion(snac *user, char *id, char *type)
|
|||||||
|
|
||||||
/* copy the 'to' field */
|
/* copy the 'to' field */
|
||||||
msg = xs_dict_set(msg, "to", xs_dict_get(object, "to"));
|
msg = xs_dict_set(msg, "to", xs_dict_get(object, "to"));
|
||||||
|
}
|
||||||
|
|
||||||
/* now we despise this */
|
/* now we despise this */
|
||||||
object_unadmire(id, user->actor, *type == 'L' ? 1 : 0);
|
object_unadmire(id, user->actor, *type == 'L' ? 1 : 0);
|
||||||
}
|
|
||||||
|
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
21
mastoapi.c
21
mastoapi.c
@ -2314,11 +2314,13 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (strcmp(op, "unfavourite") == 0) { /** **/
|
if (strcmp(op, "unfavourite") == 0) { /** **/
|
||||||
/* partial support: as the original Like message
|
xs *n_msg = msg_repulsion(&snac, id, "Like");
|
||||||
is not stored anywhere here, it's not possible
|
|
||||||
to send an Undo + Like; the only thing done here
|
if (n_msg != NULL) {
|
||||||
is to delete the actor from the list of likes */
|
enqueue_message(&snac, n_msg);
|
||||||
object_unadmire(id, snac.actor, 1);
|
|
||||||
|
out = mastoapi_status(&snac, msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (strcmp(op, "reblog") == 0) { /** **/
|
if (strcmp(op, "reblog") == 0) { /** **/
|
||||||
@ -2333,8 +2335,13 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (strcmp(op, "unreblog") == 0) { /** **/
|
if (strcmp(op, "unreblog") == 0) { /** **/
|
||||||
/* partial support: see comment in 'unfavourite' */
|
xs *n_msg = msg_repulsion(&snac, id, "Announce");
|
||||||
object_unadmire(id, snac.actor, 0);
|
|
||||||
|
if (n_msg != NULL) {
|
||||||
|
enqueue_message(&snac, n_msg);
|
||||||
|
|
||||||
|
out = mastoapi_status(&snac, msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (strcmp(op, "bookmark") == 0) { /** **/
|
if (strcmp(op, "bookmark") == 0) { /** **/
|
||||||
|
Loading…
Reference in New Issue
Block a user