diff options
| author | 2023-05-15 11:36:09 +0200 | |
|---|---|---|
| committer | 2023-05-15 11:36:09 +0200 | |
| commit | 40fa322c54f03bf2f2e47122b1301d616cdc39c4 (patch) | |
| tree | 124af1aabea385ca0b7d99ee4912658db2d02b77 | |
| parent | Made mastoapi account search case-insensitive. (diff) | |
| download | snac2-40fa322c54f03bf2f2e47122b1301d616cdc39c4.tar.gz snac2-40fa322c54f03bf2f2e47122b1301d616cdc39c4.tar.xz snac2-40fa322c54f03bf2f2e47122b1301d616cdc39c4.zip | |
mastoapi_account() returns the acct field as user@host.
| -rw-r--r-- | mastoapi.c | 8 |
1 files changed, 7 insertions, 1 deletions
| @@ -511,9 +511,15 @@ xs_dict *mastoapi_account(const xs_dict *actor) | |||
| 511 | xs *acct_md5 = xs_md5_hex(id, strlen(id)); | 511 | xs *acct_md5 = xs_md5_hex(id, strlen(id)); |
| 512 | acct = xs_dict_append(acct, "id", acct_md5); | 512 | acct = xs_dict_append(acct, "id", acct_md5); |
| 513 | acct = xs_dict_append(acct, "username", xs_dict_get(actor, "preferredUsername")); | 513 | acct = xs_dict_append(acct, "username", xs_dict_get(actor, "preferredUsername")); |
| 514 | acct = xs_dict_append(acct, "acct", xs_dict_get(actor, "preferredUsername")); | ||
| 515 | acct = xs_dict_append(acct, "display_name", display_name); | 514 | acct = xs_dict_append(acct, "display_name", display_name); |
| 516 | 515 | ||
| 516 | { | ||
| 517 | /* create the acct field as user@host */ | ||
| 518 | xs *l = xs_split(id, "/"); | ||
| 519 | xs *fquid = xs_fmt("%s@%s", xs_dict_get(actor, "preferredUsername"), xs_list_get(l, 2)); | ||
| 520 | acct = xs_dict_append(acct, "acct", fquid); | ||
| 521 | } | ||
| 522 | |||
| 517 | if (pub) | 523 | if (pub) |
| 518 | acct = xs_dict_append(acct, "created_at", pub); | 524 | acct = xs_dict_append(acct, "created_at", pub); |
| 519 | else { | 525 | else { |