make quote inlining an option

This commit is contained in:
Ted Unangst 2023-01-26 16:38:52 -05:00
parent 455989f85b
commit a45e27038f
4 changed files with 20 additions and 11 deletions

View File

@ -778,7 +778,9 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
content += fmt.Sprintf(`<p><a href="%s">%s</a>`, url, url) content += fmt.Sprintf(`<p><a href="%s">%s</a>`, url, url)
url = xid url = xid
} }
content = qutify(user, content) if user.Options.InlineQuotes {
content = qutify(user, content)
}
rid, ok = obj.GetString("inReplyTo") rid, ok = obj.GetString("inReplyTo")
if !ok { if !ok {
if robj, ok := obj.GetMap("inReplyTo"); ok { if robj, ok := obj.GetMap("inReplyTo"); ok {

19
honk.go
View File

@ -51,15 +51,16 @@ type WhatAbout struct {
} }
type UserOptions struct { type UserOptions struct {
SkinnyCSS bool `json:",omitempty"` SkinnyCSS bool `json:",omitempty"`
OmitImages bool `json:",omitempty"` OmitImages bool `json:",omitempty"`
MentionAll bool `json:",omitempty"` MentionAll bool `json:",omitempty"`
Avatar string `json:",omitempty"` InlineQuotes bool `json:",omitempty"`
Banner string `json:",omitempty"` Avatar string `json:",omitempty"`
MapLink string `json:",omitempty"` Banner string `json:",omitempty"`
Reaction string `json:",omitempty"` MapLink string `json:",omitempty"`
MeCount int64 Reaction string `json:",omitempty"`
ChatCount int64 MeCount int64
ChatCount int64
} }
type KeyInfo struct { type KeyInfo struct {

View File

@ -14,7 +14,8 @@
<input tabindex=1 type="checkbox" id="omitimages" name="omitimages" value="omitimages" {{ if .User.Options.OmitImages }}checked{{ end }}><span></span> <input tabindex=1 type="checkbox" id="omitimages" name="omitimages" value="omitimages" {{ if .User.Options.OmitImages }}checked{{ end }}><span></span>
<p><label class="button" for="mentionall">mention all:</label> <p><label class="button" for="mentionall">mention all:</label>
<input tabindex=1 type="checkbox" id="mentionall" name="mentionall" value="mentionall" {{ if .User.Options.MentionAll }}checked{{ end }}><span></span> <input tabindex=1 type="checkbox" id="mentionall" name="mentionall" value="mentionall" {{ if .User.Options.MentionAll }}checked{{ end }}><span></span>
<p><label class="button" for="inlineqts">inline quotes:</label>
<input tabindex=1 type="checkbox" id="inlineqts" name="inlineqts" value="inlineqts" {{ if .User.Options.InlineQuotes }}checked{{ end }}><span></span>
<p><label class="button" for="maps">apple map links:</label> <p><label class="button" for="maps">apple map links:</label>
<input tabindex=1 type="checkbox" id="maps" name="maps" value="apple" {{ if eq "apple" .User.Options.MapLink }}checked{{ end }}><span></span> <input tabindex=1 type="checkbox" id="maps" name="maps" value="apple" {{ if eq "apple" .User.Options.MapLink }}checked{{ end }}><span></span>
<p><label class="button" for="reaction">reaction:</label> <p><label class="button" for="reaction">reaction:</label>

5
web.go
View File

@ -1134,6 +1134,11 @@ func saveuser(w http.ResponseWriter, r *http.Request) {
} else { } else {
options.MentionAll = false options.MentionAll = false
} }
if r.FormValue("inlineqts") == "inlineqts" {
options.InlineQuotes = true
} else {
options.InlineQuotes = false
}
if r.FormValue("maps") == "apple" { if r.FormValue("maps") == "apple" {
options.MapLink = "apple" options.MapLink = "apple"
} else { } else {