modify msg-service to support dpm feature
[platform/core/messaging/msg-service.git] / plugin / mms_plugin / MmsPluginMain.cpp
index f5a1155..25f5d59 100755 (executable)
@@ -18,6 +18,7 @@
 #include "MsgException.h"
 #include "MsgGconfWrapper.h"
 #include "MsgUtilFile.h"
+#include "MsgUtilFunction.h"
 #include "MsgMmsMessage.h"
 #include "MsgSerialize.h"
 #include "MmsPluginDebug.h"
@@ -113,6 +114,11 @@ msg_error_t MmsSubmitRequest(MSG_REQUEST_INFO_S *pReqInfo)
        MSG_BEGIN();
 
        try {
+               if (msg_check_dpm_policy(pReqInfo->msgInfo.msgType.mainType) == false) {
+                       MSG_DEBUG("Messaging is restricted by DPM policy.");
+                       return MSG_ERR_DPM_RESTRICT;
+               }
+
                MmsPluginTransport::instance()->submitRequest(pReqInfo);
        } catch (MsgException& e) {
                MSG_FATAL("%s", e.what());