mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-09 19:50:26 +03:00
Partial support for mastoapi unfavourite / unreblog.
This commit is contained in:
parent
c21bbd5f7c
commit
4595a36859
2
data.c
2
data.c
@ -827,7 +827,7 @@ int object_unadmire(const char *id, const char *actor, int like)
|
||||
|
||||
status = index_del(fn, actor);
|
||||
|
||||
srv_debug(1,
|
||||
srv_debug(0,
|
||||
xs_fmt("object_unadmire (%s) %s %s %d", like ? "Like" : "Announce", actor, fn, status));
|
||||
|
||||
return status;
|
||||
|
@ -1670,7 +1670,11 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
|
||||
}
|
||||
else
|
||||
if (strcmp(op, "unfavourite") == 0) {
|
||||
/* snac does not support Undo+Like */
|
||||
/* 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);
|
||||
}
|
||||
else
|
||||
if (strcmp(op, "reblog") == 0) {
|
||||
@ -1685,7 +1689,8 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
|
||||
}
|
||||
else
|
||||
if (strcmp(op, "unreblog") == 0) {
|
||||
/* snac does not support Undo+Announce */
|
||||
/* partial support: see comment in 'unfavourite' */
|
||||
object_unadmire(id, snac.actor, 0);
|
||||
}
|
||||
else
|
||||
if (strcmp(op, "bookmark") == 0) {
|
||||
|
1
snac.h
1
snac.h
@ -83,6 +83,7 @@ int object_del_if_unref(const char *id);
|
||||
double object_ctime_by_md5(const char *md5);
|
||||
double object_ctime(const char *id);
|
||||
int object_admire(const char *id, const char *actor, int like);
|
||||
int object_unadmire(const char *id, const char *actor, int like);
|
||||
|
||||
int object_likes_len(const char *id);
|
||||
int object_announces_len(const char *id);
|
||||
|
Loading…
Reference in New Issue
Block a user