aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2025-06-24 14:34:55 +0200
committergrunfink <grunfink@comam.es>2025-06-24 14:34:55 +0200
commit9403fb41effc6da7a997898b07b6c6b46f8e2ba1 (patch)
treec107621034694d72b8fc9b8f04ce7a698baa97a1
parent1aa8fe8573bfc93f569bf266770e9f39a1c2da14 (diff)
More webmention hook tweaks.
-rw-r--r--html.c7
-rw-r--r--httpd.c13
2 files changed, 13 insertions, 7 deletions
diff --git a/html.c b/html.c
index 672ea44..aeecdf5 100644
--- a/html.c
+++ b/html.c
@@ -3531,6 +3531,13 @@ xs_str *html_notifications(snac *user, int skip, int show)
xs_html_text(L("Context")))),
h);
}
+ else
+ xs_html_add(entry,
+ xs_html_tag("p",
+ xs_html_text(L("Location: ")),
+ xs_html_tag("a",
+ xs_html_attr("href", id),
+ xs_html_text(id))));
}
if (strcmp(v, n_time) > 0) {
diff --git a/httpd.c b/httpd.c
index 9216bdc..8f2ef4d 100644
--- a/httpd.c
+++ b/httpd.c
@@ -407,11 +407,6 @@ int server_post_handler(const xs_dict *req, const char *q_path,
return status;
}
- if (!object_here(target)) {
- srv_debug(0, xs_fmt("webmention-hook target %s not / no longer here", target));
- return status;
- }
-
/* get the user */
xs *s1 = xs_replace(target, srv_baseurl, "");
@@ -419,13 +414,17 @@ int server_post_handler(const xs_dict *req, const char *q_path,
const char *uid = xs_list_get(l1, 1);
snac user;
- if (!xs_is_string(uid) || !user_open(&user, uid))
+ if (!xs_is_string(uid) || !user_open(&user, uid)) {
+ srv_debug(1, xs_fmt("webmention-hook cannot find user for %s", target));
return status;
+ }
int r = xs_webmention_hook(source, target, USER_AGENT);
- if (r > 0)
+ if (r > 0) {
notify_add(&user, "Webmention", NULL, source, target, xs_stock(XSTYPE_DICT));
+ timeline_touch(&user);
+ }
srv_log(xs_fmt("webmention-hook source=%s target=%s %d", source, target, r));