aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2025-01-04 15:55:47 +0100
committerdefault <nobody@localhost>2025-01-04 15:55:47 +0100
commit914bb61dad2bc8db81cc43c832fadfbda816bc9b (patch)
tree7bbf23d8322c639e44d034ebfa21603530dd115b
parenta504544b4105876b875ec691c035952a50790832 (diff)
More search by URL tweaks.
-rw-r--r--html.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/html.c b/html.c
index 667f525..ead7ed4 100644
--- a/html.c
+++ b/html.c
@@ -3080,36 +3080,30 @@ int html_get_handler(const xs_dict *req, const char *q_path,
q = url_acct;
}
else {
- /* if it's not already here, try to bring it to the user's timeline */
- xs *md5 = xs_md5_hex(q, strlen(q));
+ /* bring it to the user's timeline */
+ xs *object = NULL;
+ int status;
- if (!timeline_here(&snac, md5)) {
- xs *object = NULL;
- int status;
+ status = activitypub_request(&snac, q, &object);
+ snac_debug(&snac, 1, xs_fmt("Request searched URL %s %d", q, status));
- status = activitypub_request(&snac, q, &object);
- snac_debug(&snac, 1, xs_fmt("Request searched URL %s %d", q, status));
+ if (valid_status(status)) {
+ /* got it; also request the actor */
+ const char *attr_to = get_atto(object);
- if (valid_status(status)) {
- /* got it; also request the actor */
- const char *attr_to = get_atto(object);
+ if (!xs_is_null(attr_to)) {
+ status = actor_request(&snac, attr_to, &actor_obj);
- if (!xs_is_null(attr_to)) {
- status = actor_request(&snac, attr_to, &actor_obj);
+ if (valid_status(status)) {
+ /* reset the query string to be the real id */
+ url_acct = xs_dup(xs_dict_get(object, "id"));
+ q = url_acct;
- snac_debug(&snac, 1, xs_fmt("Request author %s of %s %d", attr_to, q, status));
+ /* add the post to the timeline */
+ xs *md5 = xs_md5_hex(q, strlen(q));
- if (valid_status(status)) {
- /* reset the query string to be the real id */
- url_acct = xs_dup(xs_dict_get(object, "id"));
- q = url_acct;
-
- /* add the actor */
- actor_add(attr_to, actor_obj);
-
- /* add the post to the timeline */
+ if (!timeline_here(&snac, md5))
timeline_add(&snac, q, object);
- }
}
}
}