JS8Call-Improved master
Loading...
Searching...
No Matches
MsgNotifyDB.h
1#pragma once
2
3#include <QDateTime>
4#include <QString>
5
20
21struct sqlite3;
22struct sqlite3_stmt;
23
24class MsgNotifyDB {
25public:
26 explicit MsgNotifyDB(const QString &path);
27 ~MsgNotifyDB();
28
29 bool open();
30 void close();
31 bool isOpen() const;
32 QString error() const;
33
34 // Record that we just sent (or are about to send) a notification for
35 // this message id, addressed to the given callsign.
36 bool upsertSent(int msgId, const QString &callsign, const QDateTime &ts);
37
38 // Returns the last time we notified for this message id, or an invalid
39 // QDateTime if we've never notified (or the row has been cleared).
40 QDateTime getLastSent(int msgId);
41
42 // Called once the message has been delivered (QUERY MSG retrieval) or
43 // deleted from the inbox, so notifications for it stop.
44 bool deleteByMsgId(int msgId);
45
46private:
47 QString path_;
48 sqlite3 *db_;
49};