From 664f319b28b82982d64b58c04ee693dfd35565dd Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Mon, 27 Mar 2023 12:47:48 -0400 Subject: [PATCH] search can now load posts --- docs/changelog.txt | 4 ++++ docs/honk.1 | 1 + views/xzone.html | 2 +- web.go | 6 +++++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 5fbf39c..1d3828b 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -1,5 +1,9 @@ changelog +=== next + ++ search can now load external posts + === 0.9.91 One More Time + Swallow a follow bug. diff --git a/docs/honk.1 b/docs/honk.1 index e1aef57..a5578e0 100644 --- a/docs/honk.1 +++ b/docs/honk.1 @@ -170,6 +170,7 @@ The page lists recently seen honkers that are not otherwise tracked. It also allows the import of external objects via URL, either individual posts or actor URLs, in which case their recent outbox is imported. +Probably easier to use the search box for this. .Ss Account It's all about you. An avatar may be selected from the diff --git a/views/xzone.html b/views/xzone.html index 5bc1015..9684a95 100644 --- a/views/xzone.html +++ b/views/xzone.html @@ -4,7 +4,7 @@

import -

- xid +

- xid

diff --git a/web.go b/web.go index bb1bff5..7792b71 100644 --- a/web.go +++ b/web.go @@ -549,7 +549,7 @@ func serveractor(w http.ResponseWriter, r *http.Request) { func ximport(w http.ResponseWriter, r *http.Request) { u := login.GetUserInfo(r) - xid := strings.TrimSpace(r.FormValue("xid")) + xid := strings.TrimSpace(r.FormValue("q")) xonk := getxonk(u.UserID, xid) if xonk == nil { p, _ := investigate(xid) @@ -788,6 +788,10 @@ func showconvoy(w http.ResponseWriter, r *http.Request) { } func showsearch(w http.ResponseWriter, r *http.Request) { q := r.FormValue("q") + if strings.HasPrefix(q, "https://") { + ximport(w, r) + return + } u := login.GetUserInfo(r) honks := gethonksbysearch(u.UserID, q, 0) templinfo := getInfo(r)