summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Haijo72023-06-11 16:53:50 +0200
committerGravatar Haijo72023-06-11 16:53:50 +0200
commit9b1c5cc843e5f949cef0ebecd933f4442fb52577 (patch)
tree916e8a53739f9eb2abf8dc2b69ecdd8dd0fc4063
parentadd user type to mastodon profile (diff)
downloadsnac2-9b1c5cc843e5f949cef0ebecd933f4442fb52577.tar.gz
snac2-9b1c5cc843e5f949cef0ebecd933f4442fb52577.tar.xz
snac2-9b1c5cc843e5f949cef0ebecd933f4442fb52577.zip
set bot to true in mastodon account if user type is service
-rw-r--r--mastoapi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mastoapi.c b/mastoapi.c
index ff5c756..3b9db28 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -497,11 +497,9 @@ xs_dict *mastoapi_account(const xs_dict *actor)
497 display_name = prefu; 497 display_name = prefu;
498 498
499 const char *id = xs_dict_get(actor, "id"); 499 const char *id = xs_dict_get(actor, "id");
500 const char *type = xs_dict_get(actor, "type");
501 const char *pub = xs_dict_get(actor, "published"); 500 const char *pub = xs_dict_get(actor, "published");
502 xs *acct_md5 = xs_md5_hex(id, strlen(id)); 501 xs *acct_md5 = xs_md5_hex(id, strlen(id));
503 acct = xs_dict_append(acct, "id", acct_md5); 502 acct = xs_dict_append(acct, "id", acct_md5);
504 acct = xs_dict_append(acct, "type", type);
505 acct = xs_dict_append(acct, "username", prefu); 503 acct = xs_dict_append(acct, "username", prefu);
506 acct = xs_dict_append(acct, "display_name", display_name); 504 acct = xs_dict_append(acct, "display_name", display_name);
507 505
@@ -524,6 +522,11 @@ xs_dict *mastoapi_account(const xs_dict *actor)
524 if (xs_is_null(note)) 522 if (xs_is_null(note))
525 note = ""; 523 note = "";
526 524
525 if (strcmp(xs_dict_get(actor, "type"), "Service") == 0)
526 acct = xs_dict_append(acct, "bot", "true");
527 else
528 acct = xs_dict_append(acct, "bot", "false");
529
527 acct = xs_dict_append(acct, "note", note); 530 acct = xs_dict_append(acct, "note", note);
528 531
529 acct = xs_dict_append(acct, "url", id); 532 acct = xs_dict_append(acct, "url", id);