Files
MuditaOS/module-db/queries/messages/threads/QueryThreadGetByNumber.cpp
Michał Kamoń f2ce6e946b [EGD-6707] Add single number message notification
This PR provides implementation of home screen notification for
`notSeen` messages received from a single number. The "single-number:
`notSeen` message notification distinct from "multiple-number"
notification with the following features:
 - displaying formatted contact name
 - `onActivated` it switches to respective thread window (instead of
 all thread window) in `ApplicationMessages`

 The PR also introduced some `ActiveNotificationsModel` code refactor
 to align the implementation with `Single Responsibility Principle`
2021-05-18 17:19:30 +02:00

40 lines
1.0 KiB
C++

// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include "QueryThreadGetByNumber.hpp"
#include <Interface/ThreadRecord.hpp>
#include <PhoneNumber.hpp>
#include <string>
namespace db::query
{
ThreadGetByNumber::ThreadGetByNumber(const utils::PhoneNumber::View &number)
: Query(Query::Type::Read), number(number)
{}
auto ThreadGetByNumber::getNumber() const -> const utils::PhoneNumber::View &
{
return number;
}
[[nodiscard]] auto ThreadGetByNumber::debugInfo() const -> std::string
{
return "ThreadGetByNumber";
}
ThreadGetByNumberResult::ThreadGetByNumberResult(ThreadRecord thread) : thread(std::move(thread))
{}
auto ThreadGetByNumberResult::getThread() -> ThreadRecord
{
return std::move(thread);
}
[[nodiscard]] auto ThreadGetByNumberResult::debugInfo() const -> std::string
{
return "ThreadGetByNumberResult";
}
} // namespace db::query