summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar grunfink2025-06-24 14:06:41 +0200
committerGravatar grunfink2025-06-24 14:06:41 +0200
commitf88bdd796045dd206b38e07adb13b5af4489b4c5 (patch)
treec7796a9d7a2ff7b7cfa40e3b9df3f09f999f57fa /html.c
parentSome JSON code tweaks. (diff)
downloadpenes-snac2-f88bdd796045dd206b38e07adb13b5af4489b4c5.tar.gz
penes-snac2-f88bdd796045dd206b38e07adb13b5af4489b4c5.tar.xz
penes-snac2-f88bdd796045dd206b38e07adb13b5af4489b4c5.zip
Added a webmention hook.
Diffstat (limited to 'html.c')
-rw-r--r--html.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/html.c b/html.c
index c472e3b..672ea44 100644
--- a/html.c
+++ b/html.c
@@ -868,6 +868,14 @@ xs_html *html_user_head(snac *user, const char *desc, const char *url)
868 xs_html_attr("type", "application/activity+json"), 868 xs_html_attr("type", "application/activity+json"),
869 xs_html_attr("href", url ? url : user->actor))); 869 xs_html_attr("href", url ? url : user->actor)));
870 870
871 /* webmention hook */
872 xs *wbh = xs_fmt("%s/webmention-hook", srv_baseurl);
873
874 xs_html_add(head,
875 xs_html_sctag("link",
876 xs_html_attr("rel", "webmention"),
877 xs_html_attr("href", wbh)));
878
871 return head; 879 return head;
872} 880}
873 881
@@ -3407,13 +3415,15 @@ xs_str *html_notifications(snac *user, int skip, int show)
3407 3415
3408 const char *actor_id = xs_dict_get(noti, "actor"); 3416 const char *actor_id = xs_dict_get(noti, "actor");
3409 xs *actor = NULL; 3417 xs *actor = NULL;
3418 xs *a_name = NULL;
3410 3419
3411 if (!valid_status(actor_get(actor_id, &actor))) 3420 if (valid_status(actor_get(actor_id, &actor)))
3412 continue; 3421 a_name = actor_name(actor, proxy);
3422 else
3423 a_name = xs_dup(actor_id);
3413 3424
3414 xs *a_name = actor_name(actor, proxy); 3425 xs *label_sanitized = sanitize(type);
3415 xs *label_sanatized = sanitize(type); 3426 const char *label = label_sanitized;
3416 const char *label = label_sanatized;
3417 3427
3418 if (strcmp(type, "Create") == 0) 3428 if (strcmp(type, "Create") == 0)
3419 label = L("Mention"); 3429 label = L("Mention");