switch to using handles on xzone page
This commit is contained in:
parent
8886e78b8c
commit
953f7c5743
5
fun.go
5
fun.go
|
@ -391,7 +391,10 @@ func handles(xid string) (string, string) {
|
||||||
} else {
|
} else {
|
||||||
handle = p.Handle
|
handle = p.Handle
|
||||||
}
|
}
|
||||||
stmtSaveXonker.Exec(xid, handle, "handle")
|
_, err = stmtSaveXonker.Exec(xid, handle, "handle")
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("error saving handle: %s", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if handle == xid {
|
if handle == xid {
|
||||||
return xid, xid
|
return xid, xid
|
||||||
|
|
13
honk.go
13
honk.go
|
@ -469,19 +469,22 @@ func ximport(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
func xzone(w http.ResponseWriter, r *http.Request) {
|
func xzone(w http.ResponseWriter, r *http.Request) {
|
||||||
u := login.GetUserInfo(r)
|
u := login.GetUserInfo(r)
|
||||||
var honkers []string
|
|
||||||
rows, err := stmtRecentHonkers.Query(u.UserID, u.UserID)
|
rows, err := stmtRecentHonkers.Query(u.UserID, u.UserID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("query err: %s", err)
|
log.Printf("query err: %s", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer rows.Close()
|
defer rows.Close()
|
||||||
|
var honkers []Honker
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
var s string
|
var xid string
|
||||||
rows.Scan(&s)
|
rows.Scan(&xid)
|
||||||
honkers = append(honkers, s)
|
honkers = append(honkers, Honker{ XID: xid})
|
||||||
|
}
|
||||||
|
rows.Close()
|
||||||
|
for i, _ := range honkers {
|
||||||
|
_, honkers[i].Handle = handles(honkers[i].XID)
|
||||||
}
|
}
|
||||||
|
|
||||||
templinfo := getInfo(r)
|
templinfo := getInfo(r)
|
||||||
templinfo["XCSRF"] = login.GetCSRF("ximport", r)
|
templinfo["XCSRF"] = login.GetCSRF("ximport", r)
|
||||||
templinfo["Honkers"] = honkers
|
templinfo["Honkers"] = honkers
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
</div>
|
</div>
|
||||||
{{ range .Honkers }}
|
{{ range .Honkers }}
|
||||||
<section class="honk">
|
<section class="honk">
|
||||||
<p><a href="/h?xid={{ . }}">honks</a> by {{ . }}
|
<p><a href="/h?xid={{ .XID }}">honks</a> by {{ .Handle }}
|
||||||
</section>
|
</section>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</main>
|
</main>
|
||||||
|
|
Loading…
Reference in New Issue