Last step before removing MessageFolder class completely.
[Verification] tct-messaging-*-tizen-tests 100% pass.
Signed-off-by: Michal Michalski <m.michalski2@partner.samsung.com>
Change-Id: I2fc451d80c1cdc2b9b1d0fc2e77d020eb1870e36
eventFolder->service_type = MessageType::EMAIL;
eventFolder->service_id = account_id;
- auto jsonFolder = createMessageFolder(std::to_string(mailbox_id));
- auto folder = std::make_shared<MessageFolder>(jsonFolder);
+ auto folder = std::make_shared<MessageFolder>();
+ folder->attributes = createMessageFolder(std::to_string(mailbox_id)).get<picojson::object>();
if (event != NOTI_MAILBOX_DELETE) {
auto ret = native::EmailGetMailboxById(mailbox_id, *folder);
return json;
}
-MessageFolder::MessageFolder(const picojson::value& json) {
- ScopeLogger("from json");
- attributes = json.get<picojson::object>();
-}
-
FolderPtrVector filterFolders(tizen::AbstractFilterPtr filter,
const FolderPtrVector& source_folders) {
ScopeLogger();
const std::string& parent_id = "");
struct MessageFolder {
- MessageFolder(const picojson::value& json);
picojson::object attributes;
};
SyncFolderCallbackData* callback = new SyncFolderCallbackData(queue_, callbackId, *this);
callback->setAccountId(id);
- callback->setMessageFolder(std::make_shared<MessageFolder>(v_folder));
+ auto folder_ptr = std::make_shared<MessageFolder>();
+ folder_ptr->attributes = v_folder.get<picojson::object>();
+ callback->setMessageFolder(folder_ptr);
callback->setLimit(limit);
callback->AddToQueue();
}
for (int i = 0; i < count; ++i) {
- auto json = ConvertMailboxToJson(mailboxes[i]);
- folders.push_back(MessageFolder(json));
+ MessageFolder folder;
+ folder.attributes = ConvertMailboxToJson(mailboxes[i]).get<picojson::object>();
+ folders.push_back(folder);
}
return PlatformResult();
return PlatformResult(ErrorCode::UNKNOWN_ERR, "email_get_mailbox_by_mailbox_id() failed.");
}
- folder = MessageFolder(ConvertMailboxToJson(*mailbox));
+ folder.attributes = ConvertMailboxToJson(*mailbox).get<picojson::object>();
if (EMAIL_ERROR_NONE != email_free_mailbox(&mailbox, 1)) {
LoggerW("Calling email_free_mailbox() failed.");
}