mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-10 03:50:38 +03:00
mastoapi_account() returns the acct field as user@host.
This commit is contained in:
parent
bcf267075d
commit
40fa322c54
@ -511,9 +511,15 @@ xs_dict *mastoapi_account(const xs_dict *actor)
|
|||||||
xs *acct_md5 = xs_md5_hex(id, strlen(id));
|
xs *acct_md5 = xs_md5_hex(id, strlen(id));
|
||||||
acct = xs_dict_append(acct, "id", acct_md5);
|
acct = xs_dict_append(acct, "id", acct_md5);
|
||||||
acct = xs_dict_append(acct, "username", xs_dict_get(actor, "preferredUsername"));
|
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);
|
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)
|
if (pub)
|
||||||
acct = xs_dict_append(acct, "created_at", pub);
|
acct = xs_dict_append(acct, "created_at", pub);
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user