Some more progress on the rebase fallout and this branch

This commit is contained in:
Floris Bruynooghe
2019-06-20 23:38:56 +02:00
committed by dignifiedquire
parent a791af2d90
commit ceb2b49be5
11 changed files with 187 additions and 243 deletions

View File

@@ -22,7 +22,7 @@ pub fn dc_token_save(
// foreign_id may be 0
dc_sqlite3_execute(
context,
&context.sql.clone().read().unwrap(),
&context.sql,
"INSERT INTO tokens (namespc, foreign_id, token, timestamp) VALUES (?, ?, ?, ?);",
params![namespc as i32, foreign_id as i32, as_str(token), time()],
)
@@ -57,7 +57,7 @@ pub fn dc_token_exists(
dc_sqlite3_prepare(
context,
&context.sql.clone().read().unwrap(),
&context.sql,
"SELECT id FROM tokens WHERE namespc=? AND token=?;",
)
.and_then(|mut stmt| stmt.exists(params![namespc as i32, as_str(token)]).ok())