diff options
Diffstat (limited to 'plugins/DbChecker/src/worker.cpp')
-rw-r--r-- | plugins/DbChecker/src/worker.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/DbChecker/src/worker.cpp b/plugins/DbChecker/src/worker.cpp index b77bb94469..a31d723eff 100644 --- a/plugins/DbChecker/src/worker.cpp +++ b/plugins/DbChecker/src/worker.cpp @@ -29,6 +29,27 @@ void __cdecl WorkerThread(DbToolOptions *opts) DWORD sp = 0; + if (opts->bMarkRead) { + int nCount = 0; + + for (auto &cc : Contacts()) { + DB::ECPTR pCursor(DB::Events(cc)); + while (MEVENT hEvent = pCursor.FetchNext()) { + DBEVENTINFO dbei = {}; + if (db_event_get(hEvent, &dbei)) + continue; + + if (!dbei.markedRead()) { + db_event_markRead(cc, hEvent); + nCount++; + } + } + } + + if (nCount) + AddToStatus(STATUS_MESSAGE, TranslateT("%d events marked as read"), nCount); + } + DBCHeckCallback callback; callback.pfnAddLogMessage = AddToStatus; opts->dbChecker->Start(&callback); |