diff options
| author | 2025-06-24 14:34:55 +0200 | |
|---|---|---|
| committer | 2025-06-24 14:34:55 +0200 | |
| commit | 9403fb41effc6da7a997898b07b6c6b46f8e2ba1 (patch) | |
| tree | c107621034694d72b8fc9b8f04ce7a698baa97a1 /httpd.c | |
| parent | "voided" unused arguments in server_post_handler(). (diff) | |
| download | penes-snac2-9403fb41effc6da7a997898b07b6c6b46f8e2ba1.tar.gz penes-snac2-9403fb41effc6da7a997898b07b6c6b46f8e2ba1.tar.xz penes-snac2-9403fb41effc6da7a997898b07b6c6b46f8e2ba1.zip | |
More webmention hook tweaks.
Diffstat (limited to 'httpd.c')
| -rw-r--r-- | httpd.c | 13 |
1 files changed, 6 insertions, 7 deletions
| @@ -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 | ||