mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-30 11:54:54 -04:00
EGD-3087 SMS Search implemented (#374)
* EGD-3087 WIP adding SMS Querry * EGD-3087 Added query virtual interface on Service top layer Service shouldn't implement query logic and should be proxying that. additionally: - small fixes in includes - shared service db name same way as apps and event manager * EGD-3087 Query - want to work on interface not on db * EGD-3087 Query gluecode works fine. Our query in SMS search calls getBySMSQuery Changes cut off before any potential orm interface layer * EGD-3087 WIP Interface in use * EGD-3087 Query for SMS search works as designed * EGD-3087 Query results should be on screen * EGD-3087 BUG workaround - need to deep refresh display to show data * EGD-3087 Searching for text from input works fine * EGD-3087 Showing results / or empty results depending on query * EGD-3087 Pre PR fixups * EGD-3087 Empty search - getting back to prewious window ignore current * EGD-3087 PR applied * EGD-3087 PR - style fixed * EGD-3087 Review - DB ListView handling moved to separate function * EGD-3087 Workaround: crash on use after free fix * EGD-3087 PR stylistic changes * EGD-3087 PR cleanup applied * EGD-3087 Added test for Query interface * EGD-3087 renamed getByQuery to getQuery & finished tests * EGD-3087 Post rebase fixup * EGD-3087 PR - moved ListView request part to separate function * EGD-3087 PR Fixups * EGD-3087 Post rebase style fix * EGD-3087 Added variable for DB service stack & const to getter function
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "ThreadRecord.hpp"
|
||||
#include "SMSRecord.hpp"
|
||||
#include "queries/sms/QuerySMSSearch.hpp"
|
||||
#include <cassert>
|
||||
#include <log/log.hpp>
|
||||
|
||||
@@ -127,3 +128,17 @@ ThreadRecord ThreadRecordInterface::GetByContact(uint32_t contact_id)
|
||||
ThreadRecord a = ret[0];
|
||||
return a;
|
||||
}
|
||||
|
||||
std::unique_ptr<db::QueryResult> ThreadRecordInterface::runQuery(const db::Query *query)
|
||||
{
|
||||
if (const auto local_query = dynamic_cast<const db::query::SMSSearch *>(query)) {
|
||||
return runQueryImpl(local_query);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<db::query::SMSSearchResult> ThreadRecordInterface::runQueryImpl(const db::query::SMSSearch *query)
|
||||
{
|
||||
auto db_result = smsDB->threads.getBySMSQuery(query->text, query->starting_postion, query->depth);
|
||||
return std::make_unique<db::query::SMSSearchResult>(db_result.first, db_result.second);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user