summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authorGravatar grunfink2025-07-27 04:23:31 +0200
committerGravatar grunfink2025-07-27 04:23:31 +0200
commit1a84c5eb6d7682842d605e67aa3178c27abcc5ca (patch)
treecfdce87bd36fa713069432c71616709c659b3b3a /mastoapi.c
parentmastoapi: Fixed metadata in verify_credentials. (diff)
downloadpenes-snac2-1a84c5eb6d7682842d605e67aa3178c27abcc5ca.tar.gz
penes-snac2-1a84c5eb6d7682842d605e67aa3178c27abcc5ca.tar.xz
penes-snac2-1a84c5eb6d7682842d605e67aa3178c27abcc5ca.zip
mastoapi: the 'approve_followers' toggle can also be set from apps.
Diffstat (limited to 'mastoapi.c')
-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,
3712 snac snac = {0}; 3712 snac snac = {0};
3713 int logged_in = process_auth_token(&snac, req); 3713 int logged_in = process_auth_token(&snac, req);
3714 3714
3715 if (xs_startswith(cmd, "/v1/accounts/update_credentials")) { 3715 if (xs_startswith(cmd, "/v1/accounts/update_credentials")) { /** **/
3716 /* Update user profile fields */ 3716 /* Update user profile fields */
3717 if (logged_in) { 3717 if (logged_in) {
3718 int c = 0; 3718 int c = 0;
@@ -3768,9 +3768,13 @@ int mastoapi_patch_handler(const xs_dict *req, const char *q_path,
3768 snac.config = xs_dict_set(snac.config, "metadata", new_fields); 3768 snac.config = xs_dict_set(snac.config, "metadata", new_fields);
3769 } 3769 }
3770 } 3770 }
3771 else
3772 if (strcmp(k, "locked") == 0) {
3773 snac.config = xs_dict_set(snac.config, "approve_followers",
3774 xs_stock(strcmp(v, "true") == 0 ? XSTYPE_TRUE : XSTYPE_FALSE));
3775 }
3771 /* we don't have support for the following options, yet 3776 /* we don't have support for the following options, yet
3772 - discoverable (0/1) 3777 - discoverable (0/1)
3773 - locked (0/1)
3774 */ 3778 */
3775 } 3779 }
3776 3780