summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-05-18 09:46:21 +0200
committerdefault <nobody@localhost>2023-05-18 09:46:21 +0200
commitd4695a9cbbeb88fcb7426071657e1939e00c9133 (patch)
tree7fa4622e7b7d0fbc0b7d197b6e8ec5c929e68522 /mastoapi.c
parent3738eccce2cf3a683fd63c6c443364378c3e70e9 (diff)
Mastoapi: added block / unblock.
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/mastoapi.c b/mastoapi.c
index f5701d9..104c7f1 100644
--- a/mastoapi.c
+++ b/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) {