From 1a84c5eb6d7682842d605e67aa3178c27abcc5ca Mon Sep 17 00:00:00 2001 From: grunfink Date: Sun, 27 Jul 2025 04:23:31 +0200 Subject: mastoapi: the 'approve_followers' toggle can also be set from apps. --- mastoapi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mastoapi.c') 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) */ } -- cgit v1.2.3