mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-09 19:50:26 +03:00
Mastoapi: added block / unblock.
This commit is contained in:
parent
3738eccce2
commit
d4695a9cbb
20
mastoapi.c
20
mastoapi.c
@ -2014,6 +2014,26 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if (strcmp(opt, "block") == 0) { /** **/
|
||||||
|
if (valid_status(object_get_by_md5(md5, &actor_o))) {
|
||||||
|
const char *actor = xs_dict_get(actor_o, "id");
|
||||||
|
|
||||||
|
mute(&snac, actor);
|
||||||
|
|
||||||
|
rsp = mastoapi_relationship(&snac, md5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (strcmp(opt, "unblock") == 0) { /** **/
|
||||||
|
if (valid_status(object_get_by_md5(md5, &actor_o))) {
|
||||||
|
const char *actor = xs_dict_get(actor_o, "id");
|
||||||
|
|
||||||
|
unmute(&snac, actor);
|
||||||
|
|
||||||
|
rsp = mastoapi_relationship(&snac, md5);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rsp != NULL) {
|
if (rsp != NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user