mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-18 22:18:38 -04:00
The change adjusts both cellular service as well as call and call log applications to handle properly incoming calls from private numbers.
37 lines
1.5 KiB
C++
37 lines
1.5 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 "CallLogOptionsWindow.hpp"
|
|
#include <i18n/i18n.hpp>
|
|
#include <module-services/service-db/service-db/DBServiceAPI.hpp>
|
|
#include <OptionContact.hpp>
|
|
|
|
/// below just for apps names...
|
|
|
|
std::list<gui::Option> calllogWindowOptions(app::ApplicationCallLog *app, const CalllogRecord &record)
|
|
{
|
|
std::list<gui::Option> options;
|
|
if (record.presentation != PresentationType::PR_UNKNOWN) {
|
|
auto searchResults = DBServiceAPI::ContactGetByIDWithTemporary(app, record.getContactId());
|
|
|
|
if (searchResults->empty() || !searchResults->front().isValid() || searchResults->front().isTemporary()) {
|
|
// add option - add contact
|
|
options.emplace_back(gui::Option{std::make_unique<gui::option::Contact>(
|
|
app, gui::option::ContactOperation::Add, searchResults->front())});
|
|
}
|
|
else {
|
|
// add option - contact details
|
|
options.emplace_back(gui::Option{std::make_unique<gui::option::Contact>(
|
|
app, gui::option::ContactOperation::Details, searchResults->front())});
|
|
}
|
|
}
|
|
|
|
// add option delete call option
|
|
options.push_back(gui::Option(
|
|
utils::localize.get("app_calllog_options_delete_call"),
|
|
[=](gui::Item &item) { return app->removeCalllogEntry(record); },
|
|
gui::option::Arrow::Disabled));
|
|
|
|
return options;
|
|
};
|