#include "MsgGconfWrapper.h"
#include "MsgSpamFilter.h"
+#include <phone_number.h>
+
/*==================================================================================================
FUNCTION IMPLEMENTATION
==================================================================================================*/
Check Filter by Address
========================================================================*/
int rowCnt = 0;
+ char sqlQuery[MAX_QUERY_LEN+1];
MSG_SEC_DEBUG("pMsg->addressList[0].addressVal [%s]", pMsgInfo->addressList[0].addressVal);
+#if 0
+ bool is_blocking = false;
+ int ret = phone_number_check_blocking(pMsgInfo->addressList[0].addressVal, &is_blocking);
+ if (ret != PHONE_NUMBER_ERROR_NONE)
+ MSG_WARN("phone_number_check_blocking failed! [%d]", ret);
- char sqlQuery[MAX_QUERY_LEN+1];
+ if (is_blocking == true) {
+ MSG_SEC_DEBUG("Msg is Filtered by Address : [%s]", pMsgInfo->addressList[0].addressVal);
+ pMsgInfo->folderId = MSG_SPAMBOX_ID;
+ return true;
+ }
+#else /* use phonenumber-utils API */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
-
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT FILTER_ID FROM %s WHERE FILTER_TYPE = %d AND '%s' LIKE (CASE WHEN LENGTH(FILTER_VALUE) > %d-1 THEN '%%' || SUBSTR(FILTER_VALUE, LENGTH(FILTER_VALUE)-%d+1) ELSE FILTER_VALUE END) AND FILTER_ACTIVE = 1 \
UNION SELECT FILTER_ID FROM %s WHERE FILTER_TYPE = %d AND '%s' LIKE SUBSTR(FILTER_VALUE, 1) || '%%' AND FILTER_ACTIVE = 1 \
UNION SELECT FILTER_ID FROM %s WHERE FILTER_TYPE = %d AND '%s' LIKE '%%' || SUBSTR(FILTER_VALUE, 1) || '%%' AND FILTER_ACTIVE = 1 \
MSG_SEC_DEBUG("Msg is NOT Filtered by Address : [%s]", pMsgInfo->addressList[0].addressVal);
pDbHandle->freeTable();
}
-
+#endif
/*========================================================================
Check Filter by Subject
========================================================================*/
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(libwbxml2)
BuildRequires: pkgconfig(motion)
+BuildRequires: pkgconfig(phonenumber-utils)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(tapi)
BuildRequires: pkgconfig(vconf)