search can now load posts
Ted Unangst tedu@tedunangst.com
Mon, 27 Mar 2023 12:47:48 -0400
4 files changed,
11 insertions(+),
2 deletions(-)
M
docs/changelog.txt
→
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.
M
docs/honk.1
→
docs/honk.1
@@ -170,6 +170,7 @@ .Pa xzone
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
M
views/xzone.html
→
views/xzone.html
@@ -4,7 +4,7 @@ <div class="info">
<form action="/ximport" method="POST"> <input type="hidden" name="CSRF" value="{{ .XCSRF }}"> <p><span class="title">import</span> -<p><input tabindex=1 type="text" name="xid" autocomplete=off> - xid +<p><input tabindex=1 type="text" name="q" autocomplete=off> - xid <p><button tabindex=1 name="fetch" value="fetch">fetch</button> </form> </div>
M
web.go
→
web.go
@@ -549,7 +549,7 @@ }
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 @@ honkpage(w, u, honks, templinfo)
} 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)