X-Git-Url: http://git.scottworley.com/reliable-chat/blobdiff_plain/03513e5ce2d22d140752efeb3aefa72266bd9d87..d3e2abf960f9368e7d24073d8d78d58f9a09f082:/server/server.go diff --git a/server/server.go b/server/server.go index a328785..8ce9678 100644 --- a/server/server.go +++ b/server/server.go @@ -18,6 +18,7 @@ var fetch_wake_count = expvar.NewInt("fetch_wake_count") type Message struct { Time time.Time + ID string Text string } @@ -121,10 +122,13 @@ func start_server(store Store) { }) http.HandleFunc("/speak", func(w http.ResponseWriter, r *http.Request) { - store.Add <- &Message{time.Now(), r.FormValue("text")} + store.Add <- &Message{ + time.Now(), + r.FormValue("id"), + r.FormValue("text")} }) - log.Fatal(http.ListenAndServe(":" + strconv.Itoa(*port), nil)) + log.Fatal(http.ListenAndServe(":"+strconv.Itoa(*port), nil)) } func main() {