Compare commits

..

2 Commits

Author SHA1 Message Date
chteufleur 0ffd5de65c Change README to add SQLite library 2016-04-27 21:06:56 +02:00
chteufleur fcaa5a01bc Fix bag remove to SQLite
Still not perfect, but the problem comming from go-sqlite3 library
2016-04-27 21:02:12 +02:00
2 changed files with 28 additions and 28 deletions

View File

@ -9,6 +9,7 @@ go-xmpp4steam is a XMPP/Steam gateway.
* [go-xmpp](https://git.kingpenguin.tk/chteufleur/go-xmpp) for the XMPP part. * [go-xmpp](https://git.kingpenguin.tk/chteufleur/go-xmpp) for the XMPP part.
* [go-steam](https://github.com/Philipp15b/go-steam) for the steam part. * [go-steam](https://github.com/Philipp15b/go-steam) for the steam part.
* [go-sqlite3](https://github.com/mattn/go-sqlite3) for the database part.
* [cfg](https://github.com/jimlawless/cfg) for the configuration file. * [cfg](https://github.com/jimlawless/cfg) for the configuration file.

View File

@ -88,14 +88,13 @@ func (newLine *DatabaseLine) UpdateLine() bool {
} }
func RemoveLine(jid string) bool { func RemoveLine(jid string) bool {
// Update Steam login and password to blank before deleting,
// because it is not really deleted in the SQLite file.
line := new(DatabaseLine) line := new(DatabaseLine)
line.Jid = jid line.Jid = jid
return line.UpdateLine() line.UpdateLine()
// FIXME not working
/*
log.Printf("%sRemove line %s", LogInfo, jid) log.Printf("%sRemove line %s", LogInfo, jid)
stmt, err := db.Prepare(deleteDatabaseStmt) stmt, err := db.Prepare(deleteDatabaseStmt)
if err != nil { if err != nil {
log.Printf("%sError on delete jid %s", LogError, jid, err) log.Printf("%sError on delete jid %s", LogError, jid, err)
@ -114,11 +113,11 @@ func RemoveLine(jid string) bool {
return false return false
} }
if affect == 0 { if affect == 0 {
log.Printf("%sNo line affected", LogDebug)
return false return false
} }
return true return true
*/
} }
func GetLine(jid string) *DatabaseLine { func GetLine(jid string) *DatabaseLine {