diff options
| author | 2023-06-11 16:53:50 +0200 | |
|---|---|---|
| committer | 2023-06-11 16:53:50 +0200 | |
| commit | 9b1c5cc843e5f949cef0ebecd933f4442fb52577 (patch) | |
| tree | 916e8a53739f9eb2abf8dc2b69ecdd8dd0fc4063 | |
| parent | add user type to mastodon profile (diff) | |
| download | snac2-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.c | 7 |
1 files changed, 5 insertions, 2 deletions
| @@ -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); |