move modes code to its own file; fix SQL (un)marshalling

This commit is contained in:
Jeremy Latt 2014-03-13 13:18:40 -07:00
parent 4ed0d78d87
commit d85e6681d9
7 changed files with 173 additions and 136 deletions

View file

@ -153,7 +153,7 @@ func NewClientDB() *ClientDB {
func (db *ClientDB) Add(client *Client) {
_, err := db.db.Exec(`INSERT INTO client (nickname, userhost) VALUES (?, ?)`,
client.Nick(), client.UserHost())
client.Nick().String(), client.UserHost().String())
if err != nil {
Log.error.Println("ClientDB.Add:", err)
}
@ -161,7 +161,7 @@ func (db *ClientDB) Add(client *Client) {
func (db *ClientDB) Remove(client *Client) {
_, err := db.db.Exec(`DELETE FROM client WHERE nickname = ?`,
client.Nick())
client.Nick().String())
if err != nil {
Log.error.Println("ClientDB.Remove:", err)
}