summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrunfink <grunfink@noreply.codeberg.org>2024-02-16 20:12:23 +0000
committergrunfink <grunfink@noreply.codeberg.org>2024-02-16 20:12:23 +0000
commit06660fb7746ec37c417ba28e788ae9905b19d3e6 (patch)
treeac1692b244da5b49dfd09ad0d1b4971ea26e4ce6
parent5d4e0b0914ca5410c245aa1d4b4db4580a5ca278 (diff)
parentcae37df80f4b2024b3ed1c8b0bd9cd1fe1f968d0 (diff)
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
-rw-r--r--webfinger.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/webfinger.c b/webfinger.c
index 3f28b81..a883d7f 100644
--- a/webfinger.c
+++ b/webfinger.c
@@ -172,6 +172,7 @@ int webfinger_get_handler(xs_dict *req, char *q_path,
/* build the object */
xs *acct;
xs *aaj = xs_dict_new();
+ xs *prof = xs_dict_new();
xs *links = xs_list_new();
xs *obj = xs_dict_new();
@@ -184,6 +185,12 @@ int webfinger_get_handler(xs_dict *req, char *q_path,
links = xs_list_append(links, aaj);
+ prof = xs_dict_append(prof, "rel", "http://webfinger.net/rel/profile-page");
+ prof = xs_dict_append(prof, "type", "text/html");
+ prof = xs_dict_append(prof, "href", snac.actor);
+
+ links = xs_list_append(links, prof);
+
char *avatar = xs_dict_get(snac.config, "avatar");
if (!xs_is_null(avatar) && *avatar) {
xs *d = xs_dict_new();