[TSAM-8885] implmentation for reply on active notification
[platform/core/messaging/msg-service.git] / manager / src / msg-manager-notification.cpp
index 7773359..26bff49 100644 (file)
@@ -1474,14 +1474,14 @@ void setActiveNotification(notification_h noti_h, MSG_MGR_NOTI_INFO_S *noti_info
 
                createServiceHandle(&noti_info->active_noti_svc_h[1]);
                if (noti_info->active_noti_svc_h[1]) {
-                       setServicePackageName(noti_info->active_noti_svc_h[1], MSG_DEFAULT_APP_ID);
+                       setServicePackageName(noti_info->active_noti_svc_h[1], MSG_MGR_APP_ID);
 
-                       MSG_MGR_DEBUG("Active Notification button 2 - Msg Id = [%d]", noti_info->msg_id);
-                       addServiceExtraData(noti_info->active_noti_svc_h[1], "type", "reply");
-                       addServiceExtraData(noti_info->active_noti_svc_h[1], "msgId", noti_info->msg_id);
+                       MSG_MGR_DEBUG("Active Notification button 2 - number = [%s] slot_id = [%d]", noti_info->number, noti_info->sim_idx);
+                       addServiceExtraData(noti_info->active_noti_svc_h[1], "cmd", "reply_msg");
+                       addServiceExtraData(noti_info->active_noti_svc_h[1], "addr", noti_info->number);
 
                        char slot_id[5] = {0, };
-                       snprintf(slot_id, sizeof(slot_id), "%d", noti_info->sim_idx - 1);
+                       snprintf(slot_id, sizeof(slot_id), "%d", noti_info->sim_idx);
                        addServiceExtraData(noti_info->active_noti_svc_h[1], "slot_id", slot_id);
                }
        }
@@ -1503,6 +1503,8 @@ void setActiveNotification(notification_h noti_h, MSG_MGR_NOTI_INFO_S *noti_info
        if (noti_info->active_noti_button_num > 1) {
                setNotiEventHandler(noti_h, NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1, noti_info->active_noti_svc_h[0]);
                setNotiEventHandler(noti_h, NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_2, noti_info->active_noti_svc_h[1]);
+               notification_set_text_input(noti_h, 100);
+               setNotiEventHandler(noti_h, NOTIFICATION_EVENT_TYPE_CLICK_ON_TEXT_INPUT_BUTTON, noti_info->active_noti_svc_h[1]);
                setNotiEventHandler(noti_h, NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_3, noti_info->active_noti_svc_h[2]);
 
                setNotiText(noti_h, NOTIFICATION_TEXT_TYPE_BUTTON_1, "Call", NULL);
@@ -1887,7 +1889,8 @@ int getLatestMsgInfo(MSG_MGR_NOTI_INFO_S *noti_info, bool isForInstantMessage)
                                "B.MAIN_TYPE, "
                                "B.CONV_ID, "
                                "(CASE WHEN B.MAIN_TYPE = %d AND B.NETWORK_STATUS = %d THEN (SELECT C.MSG_SIZE FROM %s C WHERE B.MSG_ID = C.MSG_ID) ELSE -1 END), "
-                               "B.ATTACHMENT_COUNT "
+                               "B.ATTACHMENT_COUNT, "
+                               "B.SIM_INDEX "
                                "FROM %s B "
                                "LEFT JOIN %s A ON A.CONV_ID=B.CONV_ID "
                                "WHERE B.READ_STATUS=0 AND (B.FOLDER_ID=%d OR B.FOLDER_ID=%d) "
@@ -1930,6 +1933,7 @@ int getLatestMsgInfo(MSG_MGR_NOTI_INFO_S *noti_info, bool isForInstantMessage)
                if (row_cnt > 0) {
                        msgSize = atoi(db_res[col_cnt+7]);
                        attachmentCnt = atoi(db_res[col_cnt+8]);
+                       noti_info->sim_idx = atoi(db_res[col_cnt+9]);
 
                        noti_info->count = smsUnreadCnt + mmsUnreadCnt;