}
}
- void OnDelete(const IEventInfo& info,
+ void DoDelete(const IEventInfo& info,
shared_ptr<item::AbstractItem> deletedItem) {
- DBG("Delete !!!");
- int ret;
-
- ret = DBManager::DeleteNotification(deletedItem);
+ int ret = DBManager::DeleteNotification(deletedItem);
if (ret == ERROR_NONE) {
/* noti owner */
facade_->DelegateManagerEvent(info, deletedItem);
}
}
+ void OnDelete(const IEventInfo& info,
+ shared_ptr<item::AbstractItem> deletedItem) {
+ DBG("Delete !!!");
+ if (info.GetEventType() == IEventInfo::EventType::DeleteAll) {
+ list<shared_ptr<item::AbstractItem>> noti_list =
+ DBManager::GetNotificationList(((const IEventInfoInternal&)info).GetUid());
+ for (auto& i : noti_list) {
+ DoDelete(info, i);
+ }
+ } else {
+ DoDelete(info, deletedItem);
+ }
+ }
+
void OnEvent(const IEventInfo& info,
list<shared_ptr<item::AbstractItem>> noti_list) override {
LOGI("Event received (%d) !!", (int)info.GetEventType());
int type = info.GetEventType();
+ if (type == IEventInfo::EventType::DeleteAll) {
+ OnDelete(info, nullptr);
+ return;
+ }
+
for (auto& i : noti_list) {
switch (type) {
case IEventInfo::EventType::Update:
return DBManager::GetNotificationList(((const IEventInfoInternal&)info).GetUid());
}
+ int OnRequestNumber(const IEventInfo& info) override {
+ DBG("Get count !!! %s", info.GetItemId().c_str());
+ return DBManager::GetNotificationList(
+ ((const IEventInfoInternal&)info).GetUid()).size();
+ }
+
int UpdateHideApp(shared_ptr<item::AbstractItem> updatedItem) {
int ret;
string hide_list;
}
}
- void OnDelete(const IEventInfo& info,
- shared_ptr<item::AbstractItem> deletedItem) override {
- DBG("Delete !!!");
- int ret;
-
- ret = DBManager::DeleteNotification(deletedItem);
+ void DoDelete(const IEventInfo& info,
+ shared_ptr<item::AbstractItem> deletedItem) {
+ int ret = DBManager::DeleteNotification(deletedItem);
if (ret == ERROR_NONE) {
facade_->DelegateReporterEvent(info, deletedItem);
} else {
}
}
+ void OnDelete(const IEventInfo& info,
+ shared_ptr<item::AbstractItem> deletedItem) override {
+ DBG("Delete !!!");
+ if (info.GetEventType() == IEventInfo::EventType::DeleteAll) {
+ list<shared_ptr<item::AbstractItem>> noti_list =
+ DBManager::GetNotificationList(info.GetOwner(),
+ ((const IEventInfoInternal&)info).GetUid());
+ for (auto& i : noti_list) {
+ DoDelete(info, i);
+ }
+ } else {
+ DoDelete(info, deletedItem);
+ }
+ }
+
list<shared_ptr<item::AbstractItem>> OnRequestEvent(const IEventInfo& info) override {
DBG("Get !!! %s", info.GetOwner().c_str());