summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonghee Ye <donghee.ye@samsung.com>2013-06-29 17:28:41 +0900
committerDonghee Ye <donghee.ye@samsung.com>2013-06-29 17:28:41 +0900
commit212bd3fb026f5828c4f4ba957237579441262287 (patch)
tree6a1a55da2897da0ac71aabac77c4f751957fc970
parent24f8f8eb64caaeaff53867b6cdf119f704a46e89 (diff)
downloadcontacts-service-212bd3fb026f5828c4f4ba957237579441262287.tar.gz
contacts-service-212bd3fb026f5828c4f4ba957237579441262287.tar.bz2
contacts-service-212bd3fb026f5828c4f4ba957237579441262287.zip
Update version 0.9.110.1
- Add propety : message alert of group - Fix : make vcard, when folding, do not divide multi-octet character - Change :make display name of japanese - Fix search condition of image path - Increase retry time of DB query Change-Id: Id9c1305c007166ea35f0a0a63ca5bd9d6a3de712
-rwxr-xr-xCMakeLists.txt2
-rw-r--r--common/ctsvc_record_contact.c2
-rw-r--r--common/ctsvc_record_group.c8
-rw-r--r--common/ctsvc_struct.h1
-rw-r--r--common/ctsvc_vcard.c42
-rw-r--r--common/ctsvc_view.c4
-rw-r--r--common/ctsvc_view.h2
-rw-r--r--common/ipc/ctsvc_ipc_group.c2
-rw-r--r--contacts-service2.manifest2
-rw-r--r--include/contacts.h1
-rwxr-xr-xinclude/contacts_views.h1
-rw-r--r--native/ctsvc_db_init.c2
-rw-r--r--native/ctsvc_db_plugin_company_helper.c2
-rw-r--r--native/ctsvc_db_plugin_company_helper.h2
-rw-r--r--native/ctsvc_db_plugin_contact_helper.c12
-rw-r--r--native/ctsvc_db_plugin_group.c20
-rwxr-xr-xnative/ctsvc_db_query.c39
-rwxr-xr-xnative/ctsvc_sqlite.c2
-rw-r--r--packaging/contacts-service.spec2
-rwxr-xr-xschema.sql1
20 files changed, 112 insertions, 37 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b205ddc..52eb615 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,7 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(EXEC_PREFIX "\${prefix}")
SET(INCLUDEDIR "\${prefix}/${DEST_INCLUDE_DIR}")
SET(VERSION_MAJOR 0)
-SET(VERSION "${VERSION_MAJOR}.9.109.2")
+SET(VERSION "${VERSION_MAJOR}.9.110.1")
EXECUTE_PROCESS(COMMAND build-util/generator.sh)
diff --git a/common/ctsvc_record_contact.c b/common/ctsvc_record_contact.c
index 0586ccc..2be6275 100644
--- a/common/ctsvc_record_contact.c
+++ b/common/ctsvc_record_contact.c
@@ -1671,7 +1671,7 @@ static int __ctsvc_contact_set_int(contacts_record_h record, unsigned int proper
contact->link_mode = value;
break;
default:
- CTS_ERR("Invalid parameter : property_id(%d) is not supported in valuecontact)", property_id);
+ CTS_ERR("Invalid parameter : property_id(%d) is not supported in value (contact)", property_id);
return CONTACTS_ERROR_INVALID_PARAMETER;
}
return CONTACTS_ERROR_NONE;
diff --git a/common/ctsvc_record_group.c b/common/ctsvc_record_group.c
index 9b46aa8..14df451 100644
--- a/common/ctsvc_record_group.c
+++ b/common/ctsvc_record_group.c
@@ -83,6 +83,7 @@ static int __ctsvc_group_destroy(contacts_record_h record, bool delete_child)
free(group->name);
free(group->ringtone_path);
free(group->vibration);
+ free(group->message_alert);
free(group->image_thumbnail_path);
free(group->extra_data);
free(group);
@@ -106,6 +107,7 @@ static int __ctsvc_group_clone(contacts_record_h record, contacts_record_h *out_
out_data->name = SAFE_STRDUP(src_data->name);
out_data->extra_data = SAFE_STRDUP(src_data->extra_data);
out_data->vibration = SAFE_STRDUP(src_data->vibration);
+ out_data->message_alert = SAFE_STRDUP(src_data->message_alert);
out_data->ringtone_path = SAFE_STRDUP(src_data->ringtone_path);
out_data->image_thumbnail_path = SAFE_STRDUP(src_data->image_thumbnail_path);
@@ -150,6 +152,9 @@ static int __ctsvc_group_get_str_real(contacts_record_h record, unsigned int pro
case CTSVC_PROPERTY_GROUP_VIBRATION:
*out_str = GET_STR(copy, group->vibration);
break;
+ case CTSVC_PROPERTY_GROUP_MESSAGE_ALERT:
+ *out_str = GET_STR(copy, group->message_alert);
+ break;
case CTSVC_PROPERTY_GROUP_EXTRA_DATA:
*out_str = GET_STR(copy, group->extra_data);
break;
@@ -211,6 +216,9 @@ static int __ctsvc_group_set_str(contacts_record_h record, unsigned int property
case CTSVC_PROPERTY_GROUP_VIBRATION:
FREEandSTRDUP(group->vibration, str);
break;
+ case CTSVC_PROPERTY_GROUP_MESSAGE_ALERT:
+ FREEandSTRDUP(group->message_alert, str);
+ break;
case CTSVC_PROPERTY_GROUP_EXTRA_DATA:
FREEandSTRDUP(group->extra_data, str);
break;
diff --git a/common/ctsvc_struct.h b/common/ctsvc_struct.h
index de762ba..80b4cb2 100644
--- a/common/ctsvc_struct.h
+++ b/common/ctsvc_struct.h
@@ -228,6 +228,7 @@ typedef struct {
char *ringtone_path;
char *vibration;
char *image_thumbnail_path;
+ char *message_alert;
}ctsvc_group_s;
typedef struct {
diff --git a/common/ctsvc_vcard.c b/common/ctsvc_vcard.c
index b279dfc..04e16ae 100644
--- a/common/ctsvc_vcard.c
+++ b/common/ctsvc_vcard.c
@@ -298,10 +298,13 @@ static int __ctsvc_vcard_append_encode_str(char **buf, int *buf_size, int len, c
static inline int __ctsvc_vcard_add_folding(char **buf, int *buf_size, int buf_len)
{
+ int char_len = 0;
char *buf_copy = NULL;
int len, result_len;
char *r;
const char *s;
+ bool content_start = false;
+ bool encode_64 = false;
buf_copy = calloc(1, *buf_size);
@@ -323,22 +326,41 @@ static inline int __ctsvc_vcard_add_folding(char **buf, int *buf_size, int buf_l
}
}
+ if (false == content_start) {
+ if (':' == *s)
+ content_start = true;
+ else if (0 == strncmp(s, "ENCODING=BASE64", strlen("ENCODING=BASE64")))
+ encode_64 = true;
+ }
+
if ('\r' == *s)
len--;
- else if ('\n' == *s)
+ else if ('\n' == *s) {
len = -1;
+ char_len = 0;
+ content_start = false;
+ encode_64 = false;
+ }
- if (CTS_VCARD_FOLDING_LIMIT == len) {
- *r = '\r';
- r++;
- *r = '\n';
- r++;
- *r = ' ';
- r++;
- len = 1;
- result_len += 3;
+ if (0 == char_len) {
+ if (false == encode_64)
+ char_len = ctsvc_check_utf8(*s);
+
+ if (CTS_VCARD_FOLDING_LIMIT <= len + char_len) {
+ *r = '\r';
+ r++;
+ *r = '\n';
+ r++;
+ *r = ' ';
+ r++;
+ len = 1;
+ result_len += 3;
+ }
}
+ if (char_len)
+ char_len--;
+
*r = *s;
r++;
s++;
diff --git a/common/ctsvc_view.c b/common/ctsvc_view.c
index 3bd0448..a95cd06 100644
--- a/common/ctsvc_view.c
+++ b/common/ctsvc_view.c
@@ -42,7 +42,8 @@ API const _contacts_group_property_ids _contacts_group = {
.image_path = CTSVC_PROPERTY_GROUP_IMAGE,
.vibration = CTSVC_PROPERTY_GROUP_VIBRATION,
.extra_data = CTSVC_PROPERTY_GROUP_EXTRA_DATA,
- .is_read_only = CTSVC_PROPERTY_GROUP_IS_READ_ONLY
+ .is_read_only = CTSVC_PROPERTY_GROUP_IS_READ_ONLY,
+ .message_alert = CTSVC_PROPERTY_GROUP_MESSAGE_ALERT
};
API const _contacts_person_property_ids _contacts_person = {
@@ -621,6 +622,7 @@ const property_info_s __property_group[] = {
{CTSVC_PROPERTY_GROUP_VIBRATION, CTSVC_SEARCH_PROPERTY_ALL, "vibration"},
{CTSVC_PROPERTY_GROUP_EXTRA_DATA, CTSVC_SEARCH_PROPERTY_ALL, "extra_data"},
{CTSVC_PROPERTY_GROUP_IS_READ_ONLY, CTSVC_SEARCH_PROPERTY_ALL, "is_read_only"},
+ {CTSVC_PROPERTY_GROUP_MESSAGE_ALERT, CTSVC_SEARCH_PROPERTY_ALL, "message_alert"},
};
const property_info_s __property_person[] = {
diff --git a/common/ctsvc_view.h b/common/ctsvc_view.h
index 27bb679..b20f15e 100644
--- a/common/ctsvc_view.h
+++ b/common/ctsvc_view.h
@@ -161,6 +161,7 @@ typedef enum {
CTSVC_PROPERTY_GROUP_VIBRATION = (CTSVC_PROPERTY_GROUP | CTSVC_VIEW_DATA_TYPE_STR) +5,
CTSVC_PROPERTY_GROUP_EXTRA_DATA = (CTSVC_PROPERTY_GROUP | CTSVC_VIEW_DATA_TYPE_STR) +6,
CTSVC_PROPERTY_GROUP_IS_READ_ONLY = (CTSVC_PROPERTY_GROUP | CTSVC_VIEW_DATA_TYPE_BOOL) +7,
+ CTSVC_PROPERTY_GROUP_MESSAGE_ALERT = (CTSVC_PROPERTY_GROUP | CTSVC_VIEW_DATA_TYPE_STR) +8,
// person
CTSVC_PROPERTY_PERSON_ID = (CTSVC_PROPERTY_PERSON | CTSVC_VIEW_DATA_TYPE_INT | CTSVC_READ_ONLY_PROPERTY),
@@ -178,6 +179,7 @@ typedef enum {
CTSVC_PROPERTY_PERSON_DISPLAY_NAME_INDEX = (CTSVC_PROPERTY_PERSON | CTSVC_VIEW_DATA_TYPE_STR | CTSVC_READ_ONLY_PROPERTY) +12,
CTSVC_PROPERTY_PERSON_STATUS = (CTSVC_PROPERTY_PERSON | CTSVC_VIEW_DATA_TYPE_STR | CTSVC_READ_ONLY_PROPERTY) +13,
CTSVC_PROPERTY_PERSON_MESSAGE_ALERT = (CTSVC_PROPERTY_PERSON | CTSVC_VIEW_DATA_TYPE_STR) +14,
+
// person-stat
CTSVC_PROPERTY_PERSON_USAGE_TYPE = (CTSVC_PROPERTY_PERSON | CTSVC_VIEW_DATA_TYPE_INT) +100,
CTSVC_PROPERTY_PERSON_TIMES_USED = (CTSVC_PROPERTY_PERSON | CTSVC_VIEW_DATA_TYPE_INT) +101,
diff --git a/common/ipc/ctsvc_ipc_group.c b/common/ipc/ctsvc_ipc_group.c
index 4029ea1..52c20ef 100644
--- a/common/ipc/ctsvc_ipc_group.c
+++ b/common/ipc/ctsvc_ipc_group.c
@@ -47,6 +47,7 @@ static int __ctsvc_ipc_unmarshal_group(pims_ipc_data_h ipc_data, const char* vie
if (ctsvc_ipc_unmarshal_string(ipc_data, &group_p->extra_data) != CONTACTS_ERROR_NONE) break;
if (ctsvc_ipc_unmarshal_string(ipc_data, &group_p->ringtone_path) != CONTACTS_ERROR_NONE) break;
if (ctsvc_ipc_unmarshal_string(ipc_data, &group_p->vibration) != CONTACTS_ERROR_NONE) break;
+ if (ctsvc_ipc_unmarshal_string(ipc_data, &group_p->message_alert) != CONTACTS_ERROR_NONE) break;
if (ctsvc_ipc_unmarshal_string(ipc_data, &group_p->image_thumbnail_path) != CONTACTS_ERROR_NONE) break;
return CONTACTS_ERROR_NONE;
@@ -71,6 +72,7 @@ static int __ctsvc_ipc_marshal_group(const contacts_record_h record, pims_ipc_da
if (ctsvc_ipc_marshal_string((group_p->extra_data),ipc_data) != CONTACTS_ERROR_NONE) break;
if (ctsvc_ipc_marshal_string((group_p->ringtone_path),ipc_data) != CONTACTS_ERROR_NONE) break;
if (ctsvc_ipc_marshal_string((group_p->vibration),ipc_data) != CONTACTS_ERROR_NONE) break;
+ if (ctsvc_ipc_marshal_string((group_p->message_alert),ipc_data) != CONTACTS_ERROR_NONE) break;
if (ctsvc_ipc_marshal_string((group_p->image_thumbnail_path),ipc_data) != CONTACTS_ERROR_NONE) break;
return CONTACTS_ERROR_NONE;
diff --git a/contacts-service2.manifest b/contacts-service2.manifest
index f7152bc..9596f5e 100644
--- a/contacts-service2.manifest
+++ b/contacts-service2.manifest
@@ -18,7 +18,7 @@
</request>
</define>
<assign>
- <filesystem path="/usr/lib/libcontacts-service2.so.0.9.109.2" label="_"/>
+ <filesystem path="/usr/lib/libcontacts-service2.so.0.9.110.1" label="_"/>
<filesystem path="/usr/lib/libcontacts-service2.so.0" label="_"/>
<filesystem path="/opt/usr/dbspace/.contacts-svc.db" label="contacts-service::db"/>
<filesystem path="/opt/usr/dbspace/.contacts-svc.db-journal" label="contacts-service::db"/>
diff --git a/include/contacts.h b/include/contacts.h
index 47e22af..4d3901a 100644
--- a/include/contacts.h
+++ b/include/contacts.h
@@ -689,6 +689,7 @@
* <tr><td>string</td><td> vibration </td><td>read, write</td><td> </td></tr>
* <tr><td>string</td><td> extra_data </td><td>read, write</td><td> </td></tr>
* <tr><td>boolean</td><td> is_read_only </td><td>read, write once</td><td> </td></tr>
+ * <tr><td>string</td><td> message_alert </td><td>read, write</td><td> </td></tr>
* </table>
*
* @section CAPI_SOCIAL_CONTACTS_SVC_VIEW_MODULE_contacts_name _contacts_name view
diff --git a/include/contacts_views.h b/include/contacts_views.h
index 90bbe36..2ed98ac 100755
--- a/include/contacts_views.h
+++ b/include/contacts_views.h
@@ -49,6 +49,7 @@ _CONTACTS_BEGIN_VIEW()
_CONTACTS_PROPERTY_STR( vibration ) // read, write
_CONTACTS_PROPERTY_STR( extra_data ) // read, write, string
_CONTACTS_PROPERTY_BOOL( is_read_only ) // read only
+ _CONTACTS_PROPERTY_STR( message_alert ) // read, write
_CONTACTS_END_VIEW( _contacts_group )
// person
diff --git a/native/ctsvc_db_init.c b/native/ctsvc_db_init.c
index 9d110d6..23c7750 100644
--- a/native/ctsvc_db_init.c
+++ b/native/ctsvc_db_init.c
@@ -127,8 +127,6 @@ static const db_table_info_s __db_tables[] = {
int ctsvc_db_plugin_init()
{
int i;
-// pims_ipc_svc_init("/opt/CONTACT_SVC", getuid(), 0660);
-
if (__ctsvc_db_view_hash_table) {
return CONTACTS_ERROR_NONE;
}
diff --git a/native/ctsvc_db_plugin_company_helper.c b/native/ctsvc_db_plugin_company_helper.c
index 16cc452..6e72fd4 100644
--- a/native/ctsvc_db_plugin_company_helper.c
+++ b/native/ctsvc_db_plugin_company_helper.c
@@ -31,8 +31,6 @@
#include "ctsvc_record.h"
#include "ctsvc_notification.h"
-#define CTS_LOGO_IMAGE_LOCATION "/opt/usr/data/contacts-svc/img/logo"
-
static int __ctsvc_company_bind_stmt(cts_stmt stmt, ctsvc_company_s *company, int start_cnt)
{
cts_stmt_bind_int(stmt, start_cnt, company->is_default);
diff --git a/native/ctsvc_db_plugin_company_helper.h b/native/ctsvc_db_plugin_company_helper.h
index aed1bfd..e885d48 100644
--- a/native/ctsvc_db_plugin_company_helper.h
+++ b/native/ctsvc_db_plugin_company_helper.h
@@ -23,6 +23,8 @@
#include "contacts.h"
#include "ctsvc_sqlite.h"
+#define CTS_LOGO_IMAGE_LOCATION "/opt/usr/data/contacts-svc/img/logo"
+
int ctsvc_db_company_insert(contacts_record_h record, int contact_id, bool is_my_profile, int *id);
int ctsvc_db_company_update(contacts_record_h record, int contact_id, bool is_my_profile);
int ctsvc_db_company_delete(int id, bool is_my_profile);
diff --git a/native/ctsvc_db_plugin_contact_helper.c b/native/ctsvc_db_plugin_contact_helper.c
index 2edf565..ee23a0c 100644
--- a/native/ctsvc_db_plugin_contact_helper.c
+++ b/native/ctsvc_db_plugin_contact_helper.c
@@ -391,8 +391,7 @@ void ctsvc_make_contact_display_name(ctsvc_contact_s *contact)
}
if (reverse_lang_type != CTSVC_LANG_KOREAN &&
- reverse_lang_type != CTSVC_LANG_CHINESE &&
- reverse_lang_type != CTSVC_LANG_JAPANESE) {
+ reverse_lang_type != CTSVC_LANG_CHINESE) {
if(name->first || name->addition)
len += snprintf(display + len, display_len - len, ",");
}
@@ -430,10 +429,8 @@ void ctsvc_make_contact_display_name(ctsvc_contact_s *contact)
reverse_lang_type = ctsvc_check_language_type(display);
}
- if (reverse_lang_type == CTSVC_LANG_JAPANESE)
- len += snprintf(display + len, display_len - len, " ");
- else if (reverse_lang_type != CTSVC_LANG_KOREAN &&
- reverse_lang_type != CTSVC_LANG_CHINESE)
+ if (reverse_lang_type != CTSVC_LANG_KOREAN &&
+ reverse_lang_type != CTSVC_LANG_CHINESE)
len += snprintf(display + len, display_len - len, ", ");
}
len += snprintf(display + len, display_len - len, "%s", name->suffix);
@@ -442,8 +439,7 @@ void ctsvc_make_contact_display_name(ctsvc_contact_s *contact)
// make display name
if (reverse_lang_type == CTSVC_LANG_KOREAN ||
- reverse_lang_type == CTSVC_LANG_CHINESE ||
- reverse_lang_type == CTSVC_LANG_JAPANESE)
+ reverse_lang_type == CTSVC_LANG_CHINESE)
contact->display_name = strdup(display);
else {
display_len -= 1; // ","
diff --git a/native/ctsvc_db_plugin_group.c b/native/ctsvc_db_plugin_group.c
index d8ab871..6205cc2 100644
--- a/native/ctsvc_db_plugin_group.c
+++ b/native/ctsvc_db_plugin_group.c
@@ -103,8 +103,8 @@ static int __ctsvc_db_group_insert_record( contacts_record_h record, int *id )
snprintf(query, sizeof(query),
"INSERT INTO "CTS_TABLE_GROUPS"(group_id, addressbook_id, group_name, created_ver, changed_ver, ringtone_path, "
- "vibration, image_thumbnail_path, extra_data, is_read_only, group_prio) "
- "VALUES(%d, %d, ?, ?, ?, ?, ?, ?, ?, %d, %lf)",
+ "vibration, message_alert, image_thumbnail_path, extra_data, is_read_only, group_prio) "
+ "VALUES(%d, %d, ?, ?, ?, ?, ?, ?, ?, ?, %d, %lf)",
group->id, group->addressbook_id, group->is_read_only, group_prio);
stmt = cts_query_prepare(query);
@@ -125,6 +125,8 @@ static int __ctsvc_db_group_insert_record( contacts_record_h record, int *id )
cts_stmt_bind_text(stmt, 4, group->ringtone_path);
if (group->vibration)
cts_stmt_bind_text(stmt, 5, group->vibration);
+ if (group->message_alert)
+ cts_stmt_bind_text(stmt, 6, group->message_alert);
if(group->image_thumbnail_path) {
char image[CTSVC_IMG_FULL_PATH_SIZE_MAX] = {0};
@@ -139,11 +141,11 @@ static int __ctsvc_db_group_insert_record( contacts_record_h record, int *id )
free(group->image_thumbnail_path);
group->image_thumbnail_path = strdup(image);
- cts_stmt_bind_text(stmt, 6, group->image_thumbnail_path);
+ cts_stmt_bind_text(stmt, 7, group->image_thumbnail_path);
}
if (group->extra_data)
- cts_stmt_bind_text(stmt, 7, group->extra_data);
+ cts_stmt_bind_text(stmt, 8, group->extra_data);
ret = cts_stmt_step(stmt);
if (CONTACTS_ERROR_NONE != ret) {
@@ -404,6 +406,8 @@ static int __ctsvc_db_group_value_set(cts_stmt stmt, contacts_record_h *record)
temp = ctsvc_stmt_get_text(stmt, i++);
group->vibration = SAFE_STRDUP(temp);
temp = ctsvc_stmt_get_text(stmt, i++);
+ group->message_alert = SAFE_STRDUP(temp);
+ temp = ctsvc_stmt_get_text(stmt, i++);
if (temp) {
snprintf(full_path, sizeof(full_path), "%s/%s", CTS_GROUP_IMAGE_LOCATION, temp);
group->image_thumbnail_path = strdup(full_path);
@@ -425,7 +429,7 @@ static int __ctsvc_db_group_get_record( int id, contacts_record_h *out_record )
len = snprintf(query, sizeof(query),
"SELECT group_id, addressbook_id, group_name, extra_data, is_read_only, "
- "ringtone_path, vibration, image_thumbnail_path "
+ "ringtone_path, vibration, message_alert, image_thumbnail_path "
"FROM "CTS_TABLE_GROUPS" WHERE group_id = %d", id);
stmt = cts_query_prepare(query);
@@ -460,7 +464,7 @@ static int __ctsvc_db_group_get_all_records( int offset, int limit, contacts_lis
len = snprintf(query, sizeof(query),
"SELECT group_id, addressbook_id, group_name, extra_data, is_read_only, "
- "ringtone_path, vibration, image_thumbnail_path "
+ "ringtone_path, vibration, message_alert, image_thumbnail_path "
"FROM "CTS_TABLE_GROUPS" ORDER BY addressbook_id, group_prio");
if (0 < limit) {
@@ -569,6 +573,10 @@ static int __ctsvc_db_group_get_records_with_query( contacts_query_h query,
temp = ctsvc_stmt_get_text(stmt, i);
group->vibration = SAFE_STRDUP(temp);
break;
+ case CTSVC_PROPERTY_GROUP_MESSAGE_ALERT:
+ temp = ctsvc_stmt_get_text(stmt, i);
+ group->message_alert = SAFE_STRDUP(temp);
+ break;
case CTSVC_PROPERTY_GROUP_EXTRA_DATA:
temp = ctsvc_stmt_get_text(stmt, i);
group->extra_data = SAFE_STRDUP(temp);
diff --git a/native/ctsvc_db_query.c b/native/ctsvc_db_query.c
index fdfb9b2..2197143 100755
--- a/native/ctsvc_db_query.c
+++ b/native/ctsvc_db_query.c
@@ -39,6 +39,8 @@
#include "ctsvc_setting.h"
#include "ctsvc_db_plugin_person_helper.h"
+#include "ctsvc_db_plugin_group_helper.h"
+#include "ctsvc_db_plugin_company_helper.h"
typedef enum {
QUERY_SORTKEY,
@@ -289,8 +291,8 @@ static inline int __ctsvc_db_create_str_condition(ctsvc_composite_filter_s *com_
if (filter->value.s) {
if (filter->property_id == CTSVC_PROPERTY_NUMBER_NUMBER_FILTER) {
- char dest[strlen(filter->value.s)+1];
- char normal_num[strlen(filter->value.s)+1];
+ char dest[strlen(filter->value.s)+1+5]; // for cc
+ char normal_num[strlen(filter->value.s)+1+5]; // for cc
ret = ctsvc_normalize_number(filter->value.s, normal_num, sizeof(normal_num));
if (0 < ret) {
ret = ctsvc_get_minmatch_number(normal_num, dest, sizeof(dest), ctsvc_get_phonenumber_min_match_digit());
@@ -305,7 +307,7 @@ static inline int __ctsvc_db_create_str_condition(ctsvc_composite_filter_s *com_
else if (filter->property_id == CTSVC_PROPERTY_NUMBER_NORMALIZED_NUMBER
|| filter->property_id == CTSVC_PROPERTY_PHONELOG_NORMALIZED_ADDRESS
|| filter->property_id == CTSVC_PROPERTY_SPEEDDIAL_NORMALIZED_NUMBER) {
- char normal_num[strlen(filter->value.s)+1];
+ char normal_num[strlen(filter->value.s)+1+5]; // for cc
ret = ctsvc_normalize_number(filter->value.s, normal_num, sizeof(normal_num));
if (0 < ret) {
*bind_text = g_slist_append(*bind_text, __ctsvc_db_get_str_with_escape(normal_num, strlen(normal_num), with_escape));
@@ -313,6 +315,37 @@ static inline int __ctsvc_db_create_str_condition(ctsvc_composite_filter_s *com_
else
return CONTACTS_ERROR_INVALID_PARAMETER;
}
+ else if (filter->property_id == CTSVC_PROPERTY_CONTACT_IMAGE_THUMBNAIL
+ || filter->property_id == CTSVC_PROPERTY_PERSON_IMAGE_THUMBNAIL
+ || filter->property_id == CTSVC_PROPERTY_MY_PROFILE_IMAGE_THUMBNAIL
+ || filter->property_id == CTSVC_PROPERTY_IMAGE_PATH) {
+ if (strncmp(filter->value.s, CTS_IMG_FULL_LOCATION, strlen(CTS_IMG_FULL_LOCATION)) == 0) {
+ *bind_text = g_slist_append(*bind_text,
+ __ctsvc_db_get_str_with_escape(filter->value.s+strlen(CTS_IMG_FULL_LOCATION)+1,
+ strlen(filter->value.s)-strlen(CTS_IMG_FULL_LOCATION)-1, with_escape));
+ }
+ else
+ *bind_text = g_slist_append(*bind_text, __ctsvc_db_get_str_with_escape(filter->value.s, strlen(filter->value.s), with_escape));
+ }
+ else if (filter->property_id == CTSVC_PROPERTY_GROUP_IMAGE) {
+ if (strncmp(filter->value.s, CTS_GROUP_IMAGE_LOCATION, strlen(CTS_GROUP_IMAGE_LOCATION)) == 0) {
+ *bind_text = g_slist_append(*bind_text,
+ __ctsvc_db_get_str_with_escape(filter->value.s+strlen(CTS_GROUP_IMAGE_LOCATION)+1,
+ strlen(filter->value.s)-strlen(CTS_GROUP_IMAGE_LOCATION)-1, with_escape));
+ }
+ else
+ *bind_text = g_slist_append(*bind_text, __ctsvc_db_get_str_with_escape(filter->value.s, strlen(filter->value.s), with_escape));
+ }
+ else if (filter->property_id == CTSVC_PROPERTY_COMPANY_LOGO) {
+ if (strncmp(filter->value.s, CTS_LOGO_IMAGE_LOCATION, strlen(CTS_LOGO_IMAGE_LOCATION)) == 0) {
+ *bind_text = g_slist_append(*bind_text,
+ __ctsvc_db_get_str_with_escape(filter->value.s+strlen(CTS_LOGO_IMAGE_LOCATION)+1,
+ strlen(filter->value.s)-strlen(CTS_LOGO_IMAGE_LOCATION)-1, with_escape));
+ }
+ else
+ *bind_text = g_slist_append(*bind_text, __ctsvc_db_get_str_with_escape(filter->value.s, strlen(filter->value.s), with_escape));
+
+ }
else
*bind_text = g_slist_append(*bind_text, __ctsvc_db_get_str_with_escape(filter->value.s, strlen(filter->value.s), with_escape));
}
diff --git a/native/ctsvc_sqlite.c b/native/ctsvc_sqlite.c
index 92ab4a6..5805acd 100755
--- a/native/ctsvc_sqlite.c
+++ b/native/ctsvc_sqlite.c
@@ -39,7 +39,7 @@
#include "ctsvc_phonelog.h"
#include "ctsvc_person.h"
-#define CTSVC_QUERY_RETRY_TIME 4
+#define CTSVC_QUERY_RETRY_TIME 8
static __thread sqlite3 *ctsvc_db = NULL;
diff --git a/packaging/contacts-service.spec b/packaging/contacts-service.spec
index 096f216..0ee95c2 100644
--- a/packaging/contacts-service.spec
+++ b/packaging/contacts-service.spec
@@ -1,6 +1,6 @@
Name: contacts-service
Summary: Contacts Service
-Version: 0.9.109.2
+Version: 0.9.110.1
Release: 1
Group: TO_BE/FILLED_IN
License: Apache-2.0
diff --git a/schema.sql b/schema.sql
index e3a25d1..181249a 100755
--- a/schema.sql
+++ b/schema.sql
@@ -236,6 +236,7 @@ CREATE TABLE groups
ringtone_path TEXT,
vibration TEXT,
image_thumbnail_path TEXT,
+ message_alert TEXT,
member_changed_ver INTEGER,
group_prio REAL
);