Add Purge flag to MsgObject.

This commit is contained in:
Martin Rotter 2020-12-10 12:20:51 +01:00
parent ac8fdf6fae
commit b077c7f846
2 changed files with 13 additions and 3 deletions

View File

@ -190,3 +190,7 @@ QList<Label*> MessageObject::assignedLabels() const {
QList<Label*> MessageObject::availableLabels() const {
return m_availableLabels;
}
bool MessageObject::alreadyStored() const {
return m_message->m_id > 0;
}

View File

@ -21,14 +21,18 @@ class MessageObject : public QObject {
Q_PROPERTY(QDateTime created READ created WRITE setCreated)
Q_PROPERTY(bool isRead READ isRead WRITE setIsRead)
Q_PROPERTY(bool isImportant READ isImportant WRITE setIsImportant)
Q_PROPERTY(bool alreadyStored READ alreadyStored)
public:
enum class FilteringAction {
// Message is normally accepted and stored in DB.
// Message is normally accepted and stored in DB or updated.
Accept = 1,
// Message is ignored and now stored in DB.
Ignore = 2
// Message is ignored and will not be stored in DB but is not purge if it already exists.
Ignore = 2,
// Message is purged from DB if it already exists.
Purge = 4
};
Q_ENUM(FilteringAction)
@ -77,6 +81,8 @@ class MessageObject : public QObject {
QList<Label*> assignedLabels() const;
QList<Label*> availableLabels() const;
bool alreadyStored() const;
// Generic Message's properties bindings.
QString feedCustomId() const;
int accountId() const;