From a45e27038f07e5743ba43ccf33d1772d6d29815a Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 26 Jan 2023 16:38:52 -0500 Subject: [PATCH] make quote inlining an option --- activity.go | 4 +++- honk.go | 19 ++++++++++--------- views/account.html | 3 ++- web.go | 5 +++++ 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/activity.go b/activity.go index f56ce72..9ecee37 100644 --- a/activity.go +++ b/activity.go @@ -778,7 +778,9 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk { content += fmt.Sprintf(`

%s`, url, url) url = xid } - content = qutify(user, content) + if user.Options.InlineQuotes { + content = qutify(user, content) + } rid, ok = obj.GetString("inReplyTo") if !ok { if robj, ok := obj.GetMap("inReplyTo"); ok { diff --git a/honk.go b/honk.go index 5807fba..51f22d3 100644 --- a/honk.go +++ b/honk.go @@ -51,15 +51,16 @@ type WhatAbout struct { } type UserOptions struct { - SkinnyCSS bool `json:",omitempty"` - OmitImages bool `json:",omitempty"` - MentionAll bool `json:",omitempty"` - Avatar string `json:",omitempty"` - Banner string `json:",omitempty"` - MapLink string `json:",omitempty"` - Reaction string `json:",omitempty"` - MeCount int64 - ChatCount int64 + SkinnyCSS bool `json:",omitempty"` + OmitImages bool `json:",omitempty"` + MentionAll bool `json:",omitempty"` + InlineQuotes bool `json:",omitempty"` + Avatar string `json:",omitempty"` + Banner string `json:",omitempty"` + MapLink string `json:",omitempty"` + Reaction string `json:",omitempty"` + MeCount int64 + ChatCount int64 } type KeyInfo struct { diff --git a/views/account.html b/views/account.html index 9aa53ce..4232b87 100644 --- a/views/account.html +++ b/views/account.html @@ -14,7 +14,8 @@

- +

+

diff --git a/web.go b/web.go index f6b21d4..c7e26b3 100644 --- a/web.go +++ b/web.go @@ -1134,6 +1134,11 @@ func saveuser(w http.ResponseWriter, r *http.Request) { } else { options.MentionAll = false } + if r.FormValue("inlineqts") == "inlineqts" { + options.InlineQuotes = true + } else { + options.InlineQuotes = false + } if r.FormValue("maps") == "apple" { options.MapLink = "apple" } else {