Egd 2835 sms unread vs unseen notifications (#514)

* [EGD-2835] thread table based sms not read notifications

* [EGD-2835] removed redundant read field from sms db table

* [EGD-2835] clear unread status of a thread if thre thread is open

* [EGD-2835] updated database documentation

* [EGD-2835] added changelog
This commit is contained in:
Alek Rudnik
2020-07-10 11:57:19 +02:00
committed by GitHub
parent 0047a0cf61
commit 3baa85363d
26 changed files with 219 additions and 183 deletions

View File

@@ -23,14 +23,12 @@ ThreadRecordInterface::~ThreadRecordInterface()
bool ThreadRecordInterface::Add(const ThreadRecord &rec)
{
auto ret = smsDB->threads.Add(ThreadsTableRow{.date = rec.date,
.msgCount = rec.msgCount,
.msgRead = rec.msgRead,
.contactID = rec.contactID,
.snippet = rec.snippet,
.type = rec.type
});
auto ret = smsDB->threads.Add(ThreadsTableRow{.date = rec.date,
.msgCount = rec.msgCount,
.unreadMsgCount = rec.unreadMsgCount,
.contactID = rec.contactID,
.snippet = rec.snippet,
.type = rec.type});
return ret;
}
@@ -49,23 +47,29 @@ bool ThreadRecordInterface::RemoveByID(uint32_t id)
bool ThreadRecordInterface::Update(const ThreadRecord &rec)
{
return smsDB->threads.Update(ThreadsTableRow{.ID = rec.ID,
.date = rec.date,
.msgCount = rec.msgCount,
.msgRead = rec.msgRead,
.contactID = rec.contactID,
.snippet = rec.snippet,
.type = rec.type
return smsDB->threads.Update(ThreadsTableRow{.ID = rec.ID,
.date = rec.date,
.msgCount = rec.msgCount,
.unreadMsgCount = rec.unreadMsgCount,
.contactID = rec.contactID,
.snippet = rec.snippet,
.type = rec.type
});
}
uint32_t ThreadRecordInterface::GetCount()
{
return smsDB->threads.GetCount();
}
uint32_t ThreadRecordInterface::GetCount(EntryState state)
{
return smsDB->threads.GetCount(state);
}
bool markAsRead();
std::unique_ptr<std::vector<ThreadRecord>> ThreadRecordInterface::GetLimitOffset(uint32_t offset, uint32_t limit)
{
auto records = std::make_unique<std::vector<ThreadRecord>>();