mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-06-14 03:25:25 -04:00
[CP-1210] Contacts imported from SIM dont show up in Mudita Center
Fix for imported contacts from SIM don't show up in Mudita Center. Added functionality to send notification after all imported contacts are added to the database.
This commit is contained in:
committed by
Łukasz Mastalerz
parent
942b837f92
commit
d7c8a8a6bf
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
||||
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
|
||||
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
||||
|
||||
#include "SimContactsRepository.hpp"
|
||||
@@ -93,11 +93,15 @@ void SimContactsRepository::save(const std::vector<bool> &selectedContacts,
|
||||
if (result == nullptr) {
|
||||
return false;
|
||||
}
|
||||
for (const auto &r : result->getResult()) {
|
||||
sendNotification(r);
|
||||
}
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
task->execute(application, this);
|
||||
}
|
||||
|
||||
@@ -141,6 +145,13 @@ void SimContactsRepository::updateImportedRecords(const std::vector<cellular::Si
|
||||
#endif
|
||||
}
|
||||
|
||||
void SimContactsRepository::sendNotification(const NotificationData ¬ificationData)
|
||||
{
|
||||
auto notificationMessage = std::make_shared<db::NotificationMessage>(
|
||||
db::Interface::Name::Contact, notificationData.first, notificationData.second);
|
||||
application->bus.sendMulticast(notificationMessage, sys::BusChannel::ServiceDBNotifications);
|
||||
}
|
||||
|
||||
#if DEBUG_SIM_IMPORT_DATA == 1
|
||||
void SimContactsRepository::printRecordsData(const std::string &name, const std::vector<ContactRecord> &data)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user