diff --git a/fun.go b/fun.go index 29c3cc1..c6809ac 100644 --- a/fun.go +++ b/fun.go @@ -295,25 +295,6 @@ func grapevine(mentions []Mention) []string { 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 diff --git a/views/honkform.html b/views/honkform.html index 2acfb79..7f33eb0 100644 --- a/views/honkform.html +++ b/views/honkform.html @@ -37,8 +37,6 @@
-
-
diff --git a/views/honkpage.js b/views/honkpage.js index cbd25c2..a93c332 100644 --- a/views/honkpage.js +++ b/views/honkpage.js @@ -257,10 +257,9 @@ function showhonkform(elem, rid, hname) { 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 = "" diff --git a/web.go b/web.go index 029a86e..52f854b 100644 --- a/web.go +++ b/web.go @@ -1436,7 +1436,6 @@ func submitwebhonk(w http.ResponseWriter, r *http.Request) { 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 @@ func submithonk(w http.ResponseWriter, r *http.Request, isAPI bool) { 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 @@ func submithonk(w http.ResponseWriter, r *http.Request, isAPI bool) { } 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 @@ func submithonk(w http.ResponseWriter, r *http.Request, isAPI bool) { 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"] = ";"