all repos — honk @ 6d6d6b3a41b7a37313eeb360abc79e4ef55ccb49

my fork of honk

split handle and username into two fields
Ted Unangst tedu@tedunangst.com
Mon, 03 Jun 2019 00:22:00 -0400
commit

6d6d6b3a41b7a37313eeb360abc79e4ef55ccb49

parent

de67e6459932911e4251f38202727ee5e8da3369

3 files changed, 8 insertions(+), 5 deletions(-)

jump to
M fun.gofun.go

@@ -38,12 +38,14 @@ h.What += "ed"

if h.Whofore == 2 || h.Whofore == 3 { h.URL = h.XID h.Noise = mentionize(h.Noise) + h.Username, h.Handle = honkerhandle(h.Honker) } else { idx := strings.LastIndexByte(h.Honker, '/') if idx != -1 { - h.Username = honkerhandle(h.Honker) + h.Username, h.Handle = honkerhandle(h.Honker) } else { h.Username = h.Honker + h.Handle = h.Honker } if h.URL == "" { h.URL = h.XID

@@ -315,12 +317,12 @@ }

return "" } -func honkerhandle(h string) string { +func honkerhandle(h string) (string, string) { m := re_unurl.FindStringSubmatch(h) if len(m) > 2 { - return m[2] + return m[2], fmt.Sprintf("%s@%s", m[2], m[1]) } - return h + return "", h } func prepend(s string, x []string) []string {
M honk.gohonk.go

@@ -54,6 +54,7 @@ UserID int64

Username string What string Honker string + Handle string Oonker string XID string RID string
M views/honk.htmlviews/honk.html

@@ -54,7 +54,7 @@ <p>

{{ if .Honk.Public }} <button onclick="bonk(this, '{{ .Honk.XID }}'); return false;"><a href="/bonk">bonk</a></button> {{ end }} -<button onclick="showhonkform('{{ .Honk.XID }}', '{{ .Honk.Username }}'); return false;"><a href="/newhonk">tonk</a></button> +<button onclick="showhonkform('{{ .Honk.XID }}', '{{ .Honk.Handle }}'); return false;"><a href="/newhonk">tonk</a></button> <form class="inlineform" action="/zonkit" method="POST"> <input type="hidden" name="CSRF" value="{{ .BonkCSRF }}"> <input type="hidden" name="honk" value="{{ .Honk.XID }}">