aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2025-07-27 04:23:31 +0200
committergrunfink <grunfink@comam.es>2025-07-27 04:23:31 +0200
commit1a84c5eb6d7682842d605e67aa3178c27abcc5ca (patch)
treecfdce87bd36fa713069432c71616709c659b3b3a
parent2e982c79e1385b568d407f6e45f2b062761dec12 (diff)
mastoapi: the 'approve_followers' toggle can also be set from apps.
-rw-r--r--mastoapi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 798edec..2331a86 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -3712,7 +3712,7 @@ int mastoapi_patch_handler(const xs_dict *req, const char *q_path,
snac snac = {0};
int logged_in = process_auth_token(&snac, req);
- if (xs_startswith(cmd, "/v1/accounts/update_credentials")) {
+ if (xs_startswith(cmd, "/v1/accounts/update_credentials")) { /** **/
/* Update user profile fields */
if (logged_in) {
int c = 0;
@@ -3768,9 +3768,13 @@ int mastoapi_patch_handler(const xs_dict *req, const char *q_path,
snac.config = xs_dict_set(snac.config, "metadata", new_fields);
}
}
+ else
+ if (strcmp(k, "locked") == 0) {
+ snac.config = xs_dict_set(snac.config, "approve_followers",
+ xs_stock(strcmp(v, "true") == 0 ? XSTYPE_TRUE : XSTYPE_FALSE));
+ }
/* we don't have support for the following options, yet
- discoverable (0/1)
- - locked (0/1)
*/
}