From 8ce18af919c1fdd419f865d179e6a508fc55f35c Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Mon, 8 Jan 2018 09:56:41 +1000 Subject: [PATCH] Mark emails as seen after downloading bluewave --- src/bluewave.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bluewave.c b/src/bluewave.c index f96fbc5..266711b 100644 --- a/src/bluewave.c +++ b/src/bluewave.c @@ -51,6 +51,7 @@ int bwave_scan_email(int areano, int totmsgs, FILE *fti_file, FILE *mix_file, FI sqlite3_stmt *res; int rc; char *sql = "SELECT sender,subject,date,body,id FROM email WHERE recipient LIKE ? AND seen = 0"; + char *sqlseen = "UPDATE email SET seen = 1 WHERE recipient LIKE ?"; char buffer[PATH_MAX]; MIX_REC mix; FTI_REC fti; @@ -111,6 +112,13 @@ int bwave_scan_email(int areano, int totmsgs, FILE *fti_file, FILE *mix_file, FI totmsgs++; } + sqlite3_finalize(res); + + rc = sqlite3_prepare_v2(db, sql, -1, &res, 0); + if (rc == SQLITE_OK) { + sqlite3_bind_text(res, 1, gUser->loginname, -1, 0); + sqlite3_step(res); + } sqlite3_finalize(res); sqlite3_close(db);