From: Keebum Kim Date: Tue, 12 Feb 2013 05:18:51 +0000 (+0900) Subject: Modify spam filter related. X-Git-Tag: accepted/tizen_2.1/20130425.035101~14^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d61beb766eaf0b6390d9e5ff0aac4a3ce7935caf;p=framework%2Fmessaging%2Fmsg-service.git Modify spam filter related. Change-Id: I8545293ce9b56687e1f09c6c53afdffd34948cbd --- diff --git a/utils/MsgSpamFilter.cpp b/utils/MsgSpamFilter.cpp index d3f5faa..c694d11 100755 --- a/utils/MsgSpamFilter.cpp +++ b/utils/MsgSpamFilter.cpp @@ -16,6 +16,7 @@ #include "MsgDebug.h" #include "MsgUtilFile.h" +#include "MsgContact.h" #include "MsgCppTypes.h" #include "MsgGconfWrapper.h" #include "MsgSpamFilter.h" @@ -176,10 +177,22 @@ bool MsgCheckFilter(MsgDbHandler *pDbHandle, MSG_MESSAGE_INFO_S *pMsgInfo) MSG_DEBUG("pData [%s]", pData); if (strcasestr(pData, filterValue) != NULL) { - MSG_DEBUG("Msg is Filtered by Subject [%s] Data [%s]", filterValue, pData); - bFiltered = true; - break; + MSG_CONTACT_INFO_S contactInfo; + memset(&contactInfo, 0x00, sizeof(MSG_CONTACT_INFO_S)); + + // Get Contact Info + if (MsgGetContactInfo(&(pMsgInfo->addressList[0]), &contactInfo) == MSG_SUCCESS) { + if (contactInfo.contactId > 0) { + MSG_DEBUG("Msg is Filtered by Subject [%s] Data [%s], but address is in contact. Skip.", filterValue, pData); + } else { + MSG_DEBUG("Msg is Filtered by Subject [%s] Data [%s]", filterValue, pData); + bFiltered = true; + break; + } + } else { + MSG_DEBUG("MsgGetContactInfo() fail."); + } } }