diff options
author | default <nobody@localhost> | 2023-05-15 11:36:09 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-05-15 11:36:09 +0200 |
commit | 40fa322c54f03bf2f2e47122b1301d616cdc39c4 (patch) | |
tree | 124af1aabea385ca0b7d99ee4912658db2d02b77 /mastoapi.c | |
parent | bcf267075d389510b4917bf3c1cf3357cbc1a1e1 (diff) |
mastoapi_account() returns the acct field as user@host.
Diffstat (limited to 'mastoapi.c')
-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) xs *acct_md5 = xs_md5_hex(id, strlen(id)); acct = xs_dict_append(acct, "id", acct_md5); acct = xs_dict_append(acct, "username", xs_dict_get(actor, "preferredUsername")); - acct = xs_dict_append(acct, "acct", xs_dict_get(actor, "preferredUsername")); acct = xs_dict_append(acct, "display_name", display_name); + { + /* create the acct field as user@host */ + xs *l = xs_split(id, "/"); + xs *fquid = xs_fmt("%s@%s", xs_dict_get(actor, "preferredUsername"), xs_list_get(l, 2)); + acct = xs_dict_append(acct, "acct", fquid); + } + if (pub) acct = xs_dict_append(acct, "created_at", pub); else { |