all repos — honk @ b0d27e034626426df022ff5ee20e78984b21157f

my fork of honk

configure display name
Anirudh Oppiliappan x@icyphox.sh
Wed, 09 Nov 2022 12:25:51 +0530
commit

b0d27e034626426df022ff5ee20e78984b21157f

parent

d77c085920669b0e62d451ee0c2df2fcd586ace4

4 files changed, 24 insertions(+), 19 deletions(-)

jump to
M activity.goactivity.go

@@ -1577,12 +1577,11 @@ j["@context"] = itiswhatitis

j["id"] = user.URL j["inbox"] = user.URL + "/inbox" j["outbox"] = user.URL + "/outbox" + if user.Options.CustomDisplay != "" { + user.Display = user.Options.CustomDisplay + } j["name"] = user.Display - if user.Options.DisplayName != "" { - j["preferredUsername"] = user.Options.DisplayName - } else { - j["preferredUsername"] = user.Name - } + j["preferredUsername"] = user.Name j["summary"] = user.HTAbout var tags []junk.Junk for _, o := range user.Onts {
M honk.gohonk.go

@@ -51,16 +51,17 @@ SecKey httpsig.PrivateKey

} type UserOptions struct { - 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 + SkinnyCSS bool `json:",omitempty"` + OmitImages bool `json:",omitempty"` + MentionAll bool `json:",omitempty"` + InlineQuotes bool `json:",omitempty"` + Avatar string `json:",omitempty"` + CustomDisplay string `json:",omitempty"` + Banner string `json:",omitempty"` + MapLink string `json:",omitempty"` + Reaction string `json:",omitempty"` + MeCount int64 + ChatCount int64 } type KeyInfo struct {
M views/account.htmlviews/account.html

@@ -17,7 +17,8 @@ <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 id="displayname">display name:</label> -<input tabindex=1 type="text" name="displayname"> +<input tabindex=1 type="text" name="displayname" value="{{ .User.Display }}"> + <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> <p><label class="button" for="reaction">reaction:</label>
M web.goweb.go

@@ -1237,14 +1237,18 @@ options.MapLink = "apple"

} else { options.MapLink = "" } + + + sendupdate := false if r.FormValue("displayname") != "" { - options.DisplayName = r.FormValue("displayname") + options.CustomDisplay = r.FormValue("displayname") + sendupdate = true } else { - options.DisplayName = "" + options.CustomDisplay = "" } + options.Reaction = r.FormValue("reaction") - sendupdate := false ava := re_avatar.FindString(whatabout) if ava != "" { whatabout = re_avatar.ReplaceAllString(whatabout, "")