summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar grunfink2025-06-24 14:34:55 +0200
committerGravatar grunfink2025-06-24 14:34:55 +0200
commit9403fb41effc6da7a997898b07b6c6b46f8e2ba1 (patch)
treec107621034694d72b8fc9b8f04ce7a698baa97a1
parent"voided" unused arguments in server_post_handler(). (diff)
downloadpenes-snac2-9403fb41effc6da7a997898b07b6c6b46f8e2ba1.tar.gz
penes-snac2-9403fb41effc6da7a997898b07b6c6b46f8e2ba1.tar.xz
penes-snac2-9403fb41effc6da7a997898b07b6c6b46f8e2ba1.zip
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)
3531 xs_html_text(L("Context")))), 3531 xs_html_text(L("Context")))),
3532 h); 3532 h);
3533 } 3533 }
3534 else
3535 xs_html_add(entry,
3536 xs_html_tag("p",
3537 xs_html_text(L("Location: ")),
3538 xs_html_tag("a",
3539 xs_html_attr("href", id),
3540 xs_html_text(id))));
3534 } 3541 }
3535 3542
3536 if (strcmp(v, n_time) > 0) { 3543 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,
407 return status; 407 return status;
408 } 408 }
409 409
410 if (!object_here(target)) {
411 srv_debug(0, xs_fmt("webmention-hook target %s not / no longer here", target));
412 return status;
413 }
414
415 /* get the user */ 410 /* get the user */
416 xs *s1 = xs_replace(target, srv_baseurl, ""); 411 xs *s1 = xs_replace(target, srv_baseurl, "");
417 412
@@ -419,13 +414,17 @@ int server_post_handler(const xs_dict *req, const char *q_path,
419 const char *uid = xs_list_get(l1, 1); 414 const char *uid = xs_list_get(l1, 1);
420 snac user; 415 snac user;
421 416
422 if (!xs_is_string(uid) || !user_open(&user, uid)) 417 if (!xs_is_string(uid) || !user_open(&user, uid)) {
418 srv_debug(1, xs_fmt("webmention-hook cannot find user for %s", target));
423 return status; 419 return status;
420 }
424 421
425 int r = xs_webmention_hook(source, target, USER_AGENT); 422 int r = xs_webmention_hook(source, target, USER_AGENT);
426 423
427 if (r > 0) 424 if (r > 0) {
428 notify_add(&user, "Webmention", NULL, source, target, xs_stock(XSTYPE_DICT)); 425 notify_add(&user, "Webmention", NULL, source, target, xs_stock(XSTYPE_DICT));
426 timeline_touch(&user);
427 }
429 428
430 srv_log(xs_fmt("webmention-hook source=%s target=%s %d", source, target, r)); 429 srv_log(xs_fmt("webmention-hook source=%s target=%s %d", source, target, r));
431 430