commit 06660fb

grunfink  ·  2024-02-16 20:12:23 +0000 UTC
parents 5d4e0b0, cae37df
Merge pull request 'webfinger: add profile-page relation to links' (#126) from khm/snac2:profile-page into master

Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/126
1 files changed,  +7, -0
+7, -0
 1@@ -172,6 +172,7 @@ int webfinger_get_handler(xs_dict *req, char *q_path,
 2         /* build the object */
 3         xs *acct;
 4         xs *aaj   = xs_dict_new();
 5+        xs *prof  = xs_dict_new();
 6         xs *links = xs_list_new();
 7         xs *obj   = xs_dict_new();
 8 
 9@@ -184,6 +185,12 @@ int webfinger_get_handler(xs_dict *req, char *q_path,
10 
11         links = xs_list_append(links, aaj);
12 
13+        prof = xs_dict_append(prof, "rel", "http://webfinger.net/rel/profile-page");
14+        prof = xs_dict_append(prof, "type", "text/html");
15+        prof = xs_dict_append(prof, "href", snac.actor);
16+
17+        links = xs_list_append(links, prof);
18+
19         char *avatar = xs_dict_get(snac.config, "avatar");
20         if (!xs_is_null(avatar) && *avatar) {
21             xs *d = xs_dict_new();