Change-Id: I4bdfd8ccb4cd1834095b095f1089dbf09f676131
Signed-off-by: Sangkoo Kim <sangkoo.kim@samsung.com>
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(capi-system-system-settings)
BuildRequires: pkgconfig(capi-telephony)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(capi-system-system-settings)
BuildRequires: pkgconfig(capi-telephony)
-BuildRequires: pkgconfig(contacts-service2)
BuildRequires: pkgconfig(cynara-client)
BuildRequires: pkgconfig(cynara-creds-commons)
BuildRequires: pkgconfig(cynara-creds-socket)
BuildRequires: pkgconfig(cynara-client)
BuildRequires: pkgconfig(cynara-creds-commons)
BuildRequires: pkgconfig(cynara-creds-socket)
BuildRequires: pkgconfig(storage)
BuildRequires: pkgconfig(tapi)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(storage)
BuildRequires: pkgconfig(tapi)
BuildRequires: pkgconfig(vconf)
+%if "%{?profile}" == "mobile"
+BuildRequires: pkgconfig(contacts-service2)
+%endif
%description
Description: Messaging Framework Library
%description
Description: Messaging Framework Library
+IF(_MSG_WEARABLE_PROFILE)
+SET(PKG_MODULES glib-2.0 vconf dlog libxml-2.0 storage json-glib-1.0 capi-system-info capi-media-thumbnail-util capi-media-image-util capi-content-media-content aul sqlite3 capi-media-metadata-extractor icu-uc)
+ELSE()
SET(PKG_MODULES glib-2.0 vconf contacts-service2 dlog libxml-2.0 storage json-glib-1.0 capi-system-info capi-media-thumbnail-util capi-media-image-util capi-content-media-content aul sqlite3 capi-media-metadata-extractor icu-uc)
SET(PKG_MODULES glib-2.0 vconf contacts-service2 dlog libxml-2.0 storage json-glib-1.0 capi-system-info capi-media-thumbnail-util capi-media-image-util capi-content-media-content aul sqlite3 capi-media-metadata-extractor icu-uc)
pkg_check_modules(utils_pkgs REQUIRED ${PKG_MODULES})
FOREACH(flag ${utils_pkgs_CFLAGS})
pkg_check_modules(utils_pkgs REQUIRED ${PKG_MODULES})
FOREACH(flag ${utils_pkgs_CFLAGS})
#include "MsgGconfWrapper.h"
#include "MsgContact.h"
#include "MsgGconfWrapper.h"
#include "MsgContact.h"
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
extern "C"
{
#include <contacts.h>
}
extern "C"
{
#include <contacts.h>
}
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
/*==================================================================================================
VARIABLES
/*==================================================================================================
VARIABLES
#define PHONENUMBER_MIN_MATCH_DIGIT VCONFKEY_CONTACTS_SVC_PHONENUMBER_MIN_MATCH_DIGIT
#define DEFAULT_MIN_MATCH_DIGIT 8
#define PHONENUMBER_MIN_MATCH_DIGIT VCONFKEY_CONTACTS_SVC_PHONENUMBER_MIN_MATCH_DIGIT
#define DEFAULT_MIN_MATCH_DIGIT 8
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
static int phonenumberMinMatchDigit = -1;
static int phonenumberMinMatchDigit = -1;
/*==================================================================================================
INTERNAL FUNCTION IMPLEMENTATION
==================================================================================================*/
/*==================================================================================================
INTERNAL FUNCTION IMPLEMENTATION
==================================================================================================*/
int countryCodeLength(const char *src)
{
int ret = 0;
int countryCodeLength(const char *src)
{
int ret = 0;
/*==================================================================================================
FUNCTION IMPLEMENTATION
==================================================================================================*/
msg_error_t MsgOpenContactSvc()
{
/*==================================================================================================
FUNCTION IMPLEMENTATION
==================================================================================================*/
msg_error_t MsgOpenContactSvc()
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
int errCode = CONTACTS_ERROR_NONE;
if (!isContactSvcConnected) {
int errCode = CONTACTS_ERROR_NONE;
if (!isContactSvcConnected) {
} else {
MSG_DEBUG("Already connected to Contact Service.");
}
} else {
MSG_DEBUG("Already connected to Contact Service.");
}
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
return MSG_SUCCESS;
}
msg_error_t MsgCloseContactSvc()
{
return MSG_SUCCESS;
}
msg_error_t MsgCloseContactSvc()
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
int errCode = CONTACTS_ERROR_NONE;
if (isContactSvcConnected) {
int errCode = CONTACTS_ERROR_NONE;
if (isContactSvcConnected) {
return MSG_ERR_DB_DISCONNECT;
}
}
return MSG_ERR_DB_DISCONNECT;
}
}
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
return MSG_SUCCESS;
}
msg_error_t MsgInitContactSvc()
{
return MSG_SUCCESS;
}
msg_error_t MsgInitContactSvc()
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
phonenumberMinMatchDigit = MsgSettingGetInt(PHONENUMBER_MIN_MATCH_DIGIT);
MSG_DEBUG("phonenumberMinMatchDigit [%d]", phonenumberMinMatchDigit);
if (phonenumberMinMatchDigit < 1) {
phonenumberMinMatchDigit = DEFAULT_MIN_MATCH_DIGIT;
}
phonenumberMinMatchDigit = MsgSettingGetInt(PHONENUMBER_MIN_MATCH_DIGIT);
MSG_DEBUG("phonenumberMinMatchDigit [%d]", phonenumberMinMatchDigit);
if (phonenumberMinMatchDigit < 1) {
phonenumberMinMatchDigit = DEFAULT_MIN_MATCH_DIGIT;
}
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
msg_error_t MsgGetContactInfo(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_CONTACT_INFO_S *pContactInfo)
{
MSG_BEGIN();
msg_error_t MsgGetContactInfo(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_CONTACT_INFO_S *pContactInfo)
{
MSG_BEGIN();
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
msg_error_t err = MSG_SUCCESS;
if ((err = MsgOpenContactSvc()) != MSG_SUCCESS) {
msg_error_t err = MSG_SUCCESS;
if ((err = MsgOpenContactSvc()) != MSG_SUCCESS) {
contacts_record_destroy(contact, true);
contacts_record_destroy(contact, true);
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
MSG_END();
return MSG_SUCCESS;
MSG_END();
return MSG_SUCCESS;
msg_error_t MsgGetContactSearchList(const char *pSearchVal, MSG_ADDRESS_INFO_S **pAddrInfo, int *count)
{
MSG_BEGIN();
msg_error_t MsgGetContactSearchList(const char *pSearchVal, MSG_ADDRESS_INFO_S **pAddrInfo, int *count)
{
MSG_BEGIN();
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
msg_error_t err = MSG_SUCCESS;
msg_error_t err = MSG_SUCCESS;
contacts_list_destroy(personNumbers, true);
contacts_list_destroy(personNumbers, true);
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
MSG_END();
return MSG_SUCCESS;
MSG_END();
return MSG_SUCCESS;
int MsgGetContactNameOrder()
{
int MsgGetContactNameOrder()
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
contacts_name_display_order_e order = CONTACTS_NAME_DISPLAY_ORDER_FIRSTLAST;
return (int)order;
contacts_name_display_order_e order = CONTACTS_NAME_DISPLAY_ORDER_FIRSTLAST;
return (int)order;
+#else
+ return 0;
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
}
msg_error_t MsgGetContactStyleDisplayName(const char *first, const char *last, const char *middle, const char *prefix, const char *suffix, int contactNameOrder, char *displayName, unsigned int size)
{
}
msg_error_t MsgGetContactStyleDisplayName(const char *first, const char *last, const char *middle, const char *prefix, const char *suffix, int contactNameOrder, char *displayName, unsigned int size)
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+
if (first == NULL || last == NULL || middle == NULL || prefix == NULL || suffix == NULL || displayName == NULL || size ==0) {
MSG_DEBUG("Invalid parameter.");
return MSG_ERR_INVALID_PARAMETER;
if (first == NULL || last == NULL || middle == NULL || prefix == NULL || suffix == NULL || displayName == NULL || size ==0) {
MSG_DEBUG("Invalid parameter.");
return MSG_ERR_INVALID_PARAMETER;
MSG_SEC_DEBUG("displayName [%s]", displayName);
MSG_SEC_DEBUG("displayName [%s]", displayName);
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
return MSG_SUCCESS;
}
void MsgAddPhoneLog(const MSG_MESSAGE_INFO_S *pMsgInfo)
{
return MSG_SUCCESS;
}
void MsgAddPhoneLog(const MSG_MESSAGE_INFO_S *pMsgInfo)
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
+
msg_error_t err = MSG_SUCCESS;
if ((err = MsgOpenContactSvc()) != MSG_SUCCESS) {
msg_error_t err = MSG_SUCCESS;
if ((err = MsgOpenContactSvc()) != MSG_SUCCESS) {
contacts_record_destroy(plog, true);
}
contacts_record_destroy(plog, true);
}
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
}
void MsgDeletePhoneLog(msg_message_id_t msgId)
{
}
void MsgDeletePhoneLog(msg_message_id_t msgId)
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
msg_error_t err = MSG_SUCCESS;
if ((err = MsgOpenContactSvc()) != MSG_SUCCESS) {
msg_error_t err = MSG_SUCCESS;
if ((err = MsgOpenContactSvc()) != MSG_SUCCESS) {
contacts_query_destroy(query);
contacts_filter_destroy(filter);
contacts_list_destroy(plogs, true);
contacts_query_destroy(query);
contacts_filter_destroy(filter);
contacts_list_destroy(plogs, true);
+#endif /* MSG_CONTACTS_SERVICE_NOT_SUPPORTED */
int MsgContactGetMinMatchDigit()
{
int MsgContactGetMinMatchDigit()
{
+#ifndef MSG_CONTACTS_SERVICE_NOT_SUPPORTED
return phonenumberMinMatchDigit;
return phonenumberMinMatchDigit;
+#else
+ return DEFAULT_MIN_MATCH_DIGIT;
+#endif
char *r = (char *)(*buf+len);
while (*s) {
char *r = (char *)(*buf+len);
while (*s) {
+ switch ((unsigned int)*s) {
case '\r':
if (*(s+1) && '\n' == *(s+1)) {
s++;
case '\r':
if (*(s+1) && '\n' == *(s+1)) {
s++;
while (*s) {
if (*s == '\\' && *(s+1)) {
char *n = (char*)(s+1);
while (*s) {
if (*s == '\\' && *(s+1)) {
char *n = (char*)(s+1);
+ switch ((unsigned int)*n) {
case 'n':
case 'N':
*r = '\n';
case 'n':
case 'N':
*r = '\n';