From 62dfe46bfbc9a9588c33aa2f4818932de0d14345 Mon Sep 17 00:00:00 2001 From: khm Date: Fri, 16 Feb 2024 11:53:23 -0800 Subject: [PATCH 1/3] webfinger: add webfinger profile page to links --- webfinger.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webfinger.c b/webfinger.c index 3f28b81..8e03698 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(); From 5bebe5f257140f1c09c8a01c3f6b9bda7f8f20ba Mon Sep 17 00:00:00 2001 From: khm Date: Fri, 16 Feb 2024 11:54:21 -0800 Subject: [PATCH 2/3] webfinger: fix stupid typo --- webfinger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webfinger.c b/webfinger.c index 8e03698..e065a94 100644 --- a/webfinger.c +++ b/webfinger.c @@ -186,7 +186,7 @@ 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, "type", "text/html"); prof = xs_dict_append(prof, "href", snac.actor); links = xs_list_append(links, prof); From cae37df80f4b2024b3ed1c8b0bd9cd1fe1f968d0 Mon Sep 17 00:00:00 2001 From: khm Date: Fri, 16 Feb 2024 11:58:10 -0800 Subject: [PATCH 3/3] webfinger: fix whitespace --- webfinger.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webfinger.c b/webfinger.c index e065a94..a883d7f 100644 --- a/webfinger.c +++ b/webfinger.c @@ -172,7 +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 *prof = xs_dict_new(); xs *links = xs_list_new(); xs *obj = xs_dict_new(); @@ -185,11 +185,11 @@ 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); + 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); + links = xs_list_append(links, prof); char *avatar = xs_dict_get(snac.config, "avatar"); if (!xs_is_null(avatar) && *avatar) {