Support pure noti-ex deletion 05/234505/1
authorJusung Son <jusung07.son@samsung.com>
Wed, 27 May 2020 02:30:11 +0000 (11:30 +0900)
committerJusung Son <jusung07.son@samsung.com>
Wed, 27 May 2020 02:30:11 +0000 (11:30 +0900)
Change-Id: Ib7819401690f895c13494b781ce15c8c379930ff
Signed-off-by: Jusung Son <jusung07.son@samsung.com>
src/notification_ex_service.cc

index e9acbc1..509a510 100644 (file)
@@ -578,10 +578,20 @@ class DPMManager : public Manager {
           DBManager::GetNotificationList(info.GetOwner(), facade_->GetUid(info),
           info.GetChannel());
       EventInfo event_info(EventInfo::Delete, info.GetOwner(), info.GetChannel());
+
       DoDelete(event_info, noti_list);
       facade_->LaunchDefaultViewer(noti_list, NOTIFICATION_OP_DELETE);
     } else {
-      int ret = DoDelete(info, deletedList);
+      int64_t priv_id = static_pointer_cast<IItemInfoInternal>
+                           (deletedList.front()->GetInfo())->GetPrivateId();
+      list<shared_ptr<item::AbstractItem>> noti_list;
+      if (priv_id == 0) {
+        noti_list = DBManager::GetNotificationList(info.GetOwner(),
+            deletedList.front()->GetId(), facade_->GetUid(info));
+      } else {
+        noti_list = deletedList;
+      }
+      int ret = DoDelete(info, noti_list);
       if (ret == ERROR_NONE)
         facade_->LaunchDefaultViewer(deletedList, NOTIFICATION_OP_DELETE);
     }