diff options
| author | 2023-05-18 09:46:21 +0200 | |
|---|---|---|
| committer | 2023-05-18 09:46:21 +0200 | |
| commit | d4695a9cbbeb88fcb7426071657e1939e00c9133 (patch) | |
| tree | 7fa4622e7b7d0fbc0b7d197b6e8ec5c929e68522 | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | penes-snac2-d4695a9cbbeb88fcb7426071657e1939e00c9133.tar.gz penes-snac2-d4695a9cbbeb88fcb7426071657e1939e00c9133.tar.xz penes-snac2-d4695a9cbbeb88fcb7426071657e1939e00c9133.zip | |
Mastoapi: added block / unblock.
| -rw-r--r-- | mastoapi.c | 20 |
1 files changed, 20 insertions, 0 deletions
| @@ -2014,6 +2014,26 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, | |||
| 2014 | } | 2014 | } |
| 2015 | } | 2015 | } |
| 2016 | } | 2016 | } |
| 2017 | else | ||
| 2018 | if (strcmp(opt, "block") == 0) { /** **/ | ||
| 2019 | if (valid_status(object_get_by_md5(md5, &actor_o))) { | ||
| 2020 | const char *actor = xs_dict_get(actor_o, "id"); | ||
| 2021 | |||
| 2022 | mute(&snac, actor); | ||
| 2023 | |||
| 2024 | rsp = mastoapi_relationship(&snac, md5); | ||
| 2025 | } | ||
| 2026 | } | ||
| 2027 | else | ||
| 2028 | if (strcmp(opt, "unblock") == 0) { /** **/ | ||
| 2029 | if (valid_status(object_get_by_md5(md5, &actor_o))) { | ||
| 2030 | const char *actor = xs_dict_get(actor_o, "id"); | ||
| 2031 | |||
| 2032 | unmute(&snac, actor); | ||
| 2033 | |||
| 2034 | rsp = mastoapi_relationship(&snac, md5); | ||
| 2035 | } | ||
| 2036 | } | ||
| 2017 | } | 2037 | } |
| 2018 | 2038 | ||
| 2019 | if (rsp != NULL) { | 2039 | if (rsp != NULL) { |