revert the funny addressing bits. for now.
This commit is contained in:
parent
64b710019e
commit
25a367d61c
19
fun.go
19
fun.go
|
@ -295,25 +295,6 @@ func grapevine(mentions []Mention) []string {
|
||||||
return s
|
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 {
|
func bunchofgrapes(s string) []Mention {
|
||||||
m := re_mentions.FindAllString(s, -1)
|
m := re_mentions.FindAllString(s, -1)
|
||||||
var mentions []Mention
|
var mentions []Mention
|
||||||
|
|
|
@ -37,8 +37,6 @@
|
||||||
<p><label for=timeend>duration:</label><br>
|
<p><label for=timeend>duration:</label><br>
|
||||||
<input type="text" name="timeend" value="{{ .Duration }}">
|
<input type="text" name="timeend" value="{{ .Duration }}">
|
||||||
</div>
|
</div>
|
||||||
<p><label for=mentions>to:</label><br>
|
|
||||||
<input type="text" name="mentions" id=mentions value="{{ .Mentions }}">
|
|
||||||
</details>
|
</details>
|
||||||
<p>
|
<p>
|
||||||
<textarea name="noise" id="honknoise">{{ .Noise }}</textarea>
|
<textarea name="noise" id="honknoise">{{ .Noise }}</textarea>
|
||||||
|
|
|
@ -257,10 +257,9 @@ function showhonkform(elem, rid, hname) {
|
||||||
elem.insertAdjacentElement('afterend', form)
|
elem.insertAdjacentElement('afterend', form)
|
||||||
}
|
}
|
||||||
var ridinput = document.getElementById("ridinput")
|
var ridinput = document.getElementById("ridinput")
|
||||||
var elmentions = document.getElementById("mentions")
|
|
||||||
if (rid) {
|
if (rid) {
|
||||||
ridinput.value = rid
|
ridinput.value = rid
|
||||||
elmentions.value = hname
|
honknoise.value = "@" + hname + " "
|
||||||
} else {
|
} else {
|
||||||
ridinput.value = ""
|
ridinput.value = ""
|
||||||
honknoise.value = ""
|
honknoise.value = ""
|
||||||
|
|
10
web.go
10
web.go
|
@ -1436,7 +1436,6 @@ func submitwebhonk(w http.ResponseWriter, r *http.Request) {
|
||||||
func submithonk(w http.ResponseWriter, r *http.Request, isAPI bool) {
|
func submithonk(w http.ResponseWriter, r *http.Request, isAPI bool) {
|
||||||
rid := r.FormValue("rid")
|
rid := r.FormValue("rid")
|
||||||
noise := r.FormValue("noise")
|
noise := r.FormValue("noise")
|
||||||
mentions := r.FormValue("mentions")
|
|
||||||
format := r.FormValue("format")
|
format := r.FormValue("format")
|
||||||
if format == "" {
|
if format == "" {
|
||||||
format = "markdown"
|
format = "markdown"
|
||||||
|
@ -1481,7 +1480,7 @@ func submithonk(w http.ResponseWriter, r *http.Request, isAPI bool) {
|
||||||
noise = strings.Replace(noise, "\r", "", -1)
|
noise = strings.Replace(noise, "\r", "", -1)
|
||||||
noise = quickrename(noise, userinfo.UserID)
|
noise = quickrename(noise, userinfo.UserID)
|
||||||
noise = hooterize(noise)
|
noise = hooterize(noise)
|
||||||
honk.Mentions = append(grapeape(userinfo.UserID, mentions), bunchofgrapes(noise)...)
|
honk.Mentions = bunchofgrapes(noise)
|
||||||
honk.Noise = noise
|
honk.Noise = noise
|
||||||
translate(honk)
|
translate(honk)
|
||||||
|
|
||||||
|
@ -1512,10 +1511,10 @@ func submithonk(w http.ResponseWriter, r *http.Request, isAPI bool) {
|
||||||
} else {
|
} else {
|
||||||
honk.Audience = []string{thewholeworld}
|
honk.Audience = []string{thewholeworld}
|
||||||
}
|
}
|
||||||
if mentions != "" {
|
if honk.Noise != "" && honk.Noise[0] == '@' {
|
||||||
honk.Audience = append(grapevine(honk.Mentions), honk.Audience...)
|
honk.Audience = append(grapevine(bunchofgrapes(honk.Noise)), honk.Audience...)
|
||||||
} else {
|
} else {
|
||||||
honk.Audience = append(honk.Audience, grapevine(honk.Mentions)...)
|
honk.Audience = append(honk.Audience, grapevine(bunchofgrapes(honk.Noise))...)
|
||||||
}
|
}
|
||||||
|
|
||||||
if convoy == "" {
|
if convoy == "" {
|
||||||
|
@ -1677,7 +1676,6 @@ func submithonk(w http.ResponseWriter, r *http.Request, isAPI bool) {
|
||||||
templinfo["MapLink"] = getmaplink(userinfo)
|
templinfo["MapLink"] = getmaplink(userinfo)
|
||||||
templinfo["InReplyTo"] = r.FormValue("rid")
|
templinfo["InReplyTo"] = r.FormValue("rid")
|
||||||
templinfo["Noise"] = r.FormValue("noise")
|
templinfo["Noise"] = r.FormValue("noise")
|
||||||
templinfo["Mentions"] = r.FormValue("mentions")
|
|
||||||
templinfo["SavedFile"] = donkxid
|
templinfo["SavedFile"] = donkxid
|
||||||
if tm := honk.Time; tm != nil {
|
if tm := honk.Time; tm != nil {
|
||||||
templinfo["ShowTime"] = ";"
|
templinfo["ShowTime"] = ";"
|
||||||
|
|
Loading…
Reference in New Issue