summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-05-15 11:36:09 +0200
committerdefault <nobody@localhost>2023-05-15 11:36:09 +0200
commit40fa322c54f03bf2f2e47122b1301d616cdc39c4 (patch)
tree124af1aabea385ca0b7d99ee4912658db2d02b77 /mastoapi.c
parentbcf267075d389510b4917bf3c1cf3357cbc1a1e1 (diff)
mastoapi_account() returns the acct field as user@host.
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mastoapi.c b/mastoapi.c
index b1e2f79..5c29a93 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -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 {