all repos — honk @ 21107dbd1a3e73f84b412720c185a0011e5eb0a2

my fork of honk

revert the funny addressing bits. for now.
Ted Unangst tedu@tedunangst.com
Wed, 26 Feb 2020 10:37:54 -0500
commit

21107dbd1a3e73f84b412720c185a0011e5eb0a2

parent

48ac9639a4f9d65bd227055f14b54fbf938b5fe6

4 files changed, 5 insertions(+), 29 deletions(-)

jump to
M fun.gofun.go

@@ -295,25 +295,6 @@ }

return s } -func grapeape(userid int64, s string) []Mention { - var mentions []Mention - for _, m := range strings.Split(s, " ") { - if m == "" { - continue - } - var where string - if name := fullname(m, userid); name != "" { - where = name - } else { - where = gofish(m) - } - if where != "" { - mentions = append(mentions, Mention{Who: m, Where: where}) - } - } - return mentions -} - func bunchofgrapes(s string) []Mention { m := re_mentions.FindAllString(s, -1) var mentions []Mention
M views/honkform.htmlviews/honkform.html

@@ -37,8 +37,6 @@ <input type="text" name="timestart" value="{{ .StartTime }}">

<p><label for=timeend>duration:</label><br> <input type="text" name="timeend" value="{{ .Duration }}"> </div> -<p><label for=mentions>to:</label><br> -<input type="text" name="mentions" id=mentions value="{{ .Mentions }}"> </details> <p> <textarea name="noise" id="honknoise">{{ .Noise }}</textarea>
M views/honkpage.jsviews/honkpage.js

@@ -257,10 +257,9 @@ elem = document.getElementById("honkformhost")

elem.insertAdjacentElement('afterend', form) } var ridinput = document.getElementById("ridinput") - var elmentions = document.getElementById("mentions") if (rid) { ridinput.value = rid - elmentions.value = hname + honknoise.value = "@" + hname + " " } else { ridinput.value = "" honknoise.value = ""
M web.goweb.go

@@ -1436,7 +1436,6 @@ // what a hot mess this function is

func submithonk(w http.ResponseWriter, r *http.Request, isAPI bool) { rid := r.FormValue("rid") noise := r.FormValue("noise") - mentions := r.FormValue("mentions") format := r.FormValue("format") if format == "" { format = "markdown"

@@ -1481,7 +1480,7 @@

noise = strings.Replace(noise, "\r", "", -1) noise = quickrename(noise, userinfo.UserID) noise = hooterize(noise) - honk.Mentions = append(grapeape(userinfo.UserID, mentions), bunchofgrapes(noise)...) + honk.Mentions = bunchofgrapes(noise) honk.Noise = noise translate(honk)

@@ -1512,10 +1511,10 @@ }

} else { honk.Audience = []string{thewholeworld} } - if mentions != "" { - honk.Audience = append(grapevine(honk.Mentions), honk.Audience...) + if honk.Noise != "" && honk.Noise[0] == '@' { + honk.Audience = append(grapevine(bunchofgrapes(honk.Noise)), honk.Audience...) } else { - honk.Audience = append(honk.Audience, grapevine(honk.Mentions)...) + honk.Audience = append(honk.Audience, grapevine(bunchofgrapes(honk.Noise))...) } if convoy == "" {

@@ -1677,7 +1676,6 @@ templinfo["Honks"] = honks

templinfo["MapLink"] = getmaplink(userinfo) templinfo["InReplyTo"] = r.FormValue("rid") templinfo["Noise"] = r.FormValue("noise") - templinfo["Mentions"] = r.FormValue("mentions") templinfo["SavedFile"] = donkxid if tm := honk.Time; tm != nil { templinfo["ShowTime"] = ";"