modify msg-service to support dpm feature
[platform/core/messaging/msg-service.git] / framework / deliver-handler / MsgDeliverHandler.cpp
index 268e269..633025a 100755 (executable)
@@ -285,6 +285,13 @@ msg_error_t MsgHandleSMS(MSG_MESSAGE_INFO_S *pMsgInfo, bool *pSendNoti, bool *bO
 #endif
        }
 
+       if (msg_check_dpm_policy(pMsgInfo->msgType.mainType) == false) {
+               MSG_DEBUG("Messaging is restricted by DPM policy.");
+               pMsgInfo->bRestricted = true;
+               *pSendNoti = false;
+               *bOnlyNoti = false;
+       }
+
        if (pMsgInfo->msgType.subType == MSG_NORMAL_SMS) {
                MSG_DEBUG("Add Normal Message");
                err = MsgStoAddMessage(pMsgInfo, &send_opt);
@@ -578,6 +585,12 @@ msg_error_t MsgHandleMMS(MSG_MESSAGE_INFO_S *pMsgInfo,  bool *pSendNoti)
                        }
                }
 
+               if (msg_check_dpm_policy(pMsgInfo->msgType.mainType) == false) {
+                       MSG_DEBUG("Messaging is restricted by DPM policy.");
+                       pMsgInfo->bRestricted = true;
+                       *pSendNoti = false;
+               }
+
                err = MsgStoAddMessage(pMsgInfo, NULL);
 
                if (err != MSG_SUCCESS) {