Change-Id: Ia81421889943547d63e91c4ae2d68f346a25f56f
Signed-off-by: Jongkyu Koo <jk.koo@samsung.com>
* update phonelog
* CASE : do not know the proper new person_id
*/
* update phonelog
* CASE : do not know the proper new person_id
*/
- ctsvc_db_phone_log_update_person_id(NULL, person_id, -1, false);
+ ctsvc_db_phone_log_update_person_id(NULL, person_id, -1, false, NULL);
#endif /* ENABLE_LOG_FEATURE */
sqlite3_result_null(context);
return;
#endif /* ENABLE_LOG_FEATURE */
sqlite3_result_null(context);
return;
* Because, when deleting, ctsvc_db_person_delete_callback will be called
* the logic takes more time to find proper person_id (base_person_id)
*/
* Because, when deleting, ctsvc_db_person_delete_callback will be called
* the logic takes more time to find proper person_id (base_person_id)
*/
- ctsvc_db_phone_log_update_person_id(NULL, person_id, base_person_id, true);
+ ctsvc_db_phone_log_update_person_id(NULL, person_id, base_person_id, true, NULL);
#endif /* ENABLE_LOG_FEATURE */
snprintf(query, sizeof(query), "DELETE FROM %s WHERE person_id = %d",
#endif /* ENABLE_LOG_FEATURE */
snprintf(query, sizeof(query), "DELETE FROM %s WHERE person_id = %d",
#ifdef ENABLE_LOG_FEATURE
/* update phonelog */
#ifdef ENABLE_LOG_FEATURE
/* update phonelog */
- ctsvc_db_phone_log_update_person_id(NULL, person_id, id, false);
+ ctsvc_db_phone_log_update_person_id(NULL, person_id, id, false, NULL);
#endif /* ENABLE_LOG_FEATURE */
if (out_person_id)
#endif /* ENABLE_LOG_FEATURE */
if (out_person_id)
ctsvc_person_aggregate(person_id);
#ifdef ENABLE_LOG_FEATURE
/* update phonelog */
ctsvc_person_aggregate(person_id);
#ifdef ENABLE_LOG_FEATURE
/* update phonelog */
- ctsvc_db_phone_log_update_person_id(NULL, person_id, -1, false);
+ ctsvc_db_phone_log_update_person_id(NULL, person_id, -1, false, NULL);
#endif /* ENABLE_LOG_FEATURE */
}
ctsvc_stmt_finalize(stmt);
#endif /* ENABLE_LOG_FEATURE */
}
ctsvc_stmt_finalize(stmt);
}
int ctsvc_db_phone_log_update_person_id(const char *number, int old_person_id,
}
int ctsvc_db_phone_log_update_person_id(const char *number, int old_person_id,
- int candidate_person_id, bool person_link)
+ int candidate_person_id, bool person_link, int *found_person_id)
minmatch_address, -1, &number_type);
if (new_person_id <= 0)
continue;
minmatch_address, -1, &number_type);
if (new_person_id <= 0)
continue;
+
+ if (found_person_id)
+ *found_person_id = new_person_id;
} else if (number && 0 < old_person_id) {
/* CASE : number update/delete (contact update/delete) => find new_person_id by address */
/* CASE : phonelog insert with person_id */
} else if (number && 0 < old_person_id) {
/* CASE : number update/delete (contact update/delete) => find new_person_id by address */
/* CASE : phonelog insert with person_id */
int ctsvc_phone_log_delete(contacts_phone_log_delete_e op, ...);
void ctsvc_db_phone_log_delete_callback(sqlite3_context *context,
int argc, sqlite3_value **argv);
int ctsvc_phone_log_delete(contacts_phone_log_delete_e op, ...);
void ctsvc_db_phone_log_delete_callback(sqlite3_context *context,
int argc, sqlite3_value **argv);
-int ctsvc_db_phone_log_update_person_id(const char *number, int old_person_id, int candidate_person_id, bool person_link);
+int ctsvc_db_phone_log_update_person_id(const char *number, int old_person_id, int candidate_person_id, bool person_link, int *found_person_id);
#endif /* __CTSVC_SERVER_PHONELOG_H__ */
#endif /* __CTSVC_SERVER_PHONELOG_H__ */
do {
contacts_list_get_current_record_p((contacts_list_h)contact->numbers, (contacts_record_h*)&number_record);
if (number_record->number)
do {
contacts_list_get_current_record_p((contacts_list_h)contact->numbers, (contacts_record_h*)&number_record);
if (number_record->number)
- ctsvc_db_phone_log_update_person_id(number_record->number, -1, contact->person_id, false);
+ ctsvc_db_phone_log_update_person_id(number_record->number, -1, contact->person_id, false, NULL);
} while (CONTACTS_ERROR_NONE == contacts_list_next((contacts_list_h)contact->numbers));
}
}
} while (CONTACTS_ERROR_NONE == contacts_list_next((contacts_list_h)contact->numbers));
}
}
#ifdef ENABLE_LOG_FEATURE
/* update phonelog */
#ifdef ENABLE_LOG_FEATURE
/* update phonelog */
- ctsvc_db_phone_log_update_person_id(NULL, person_id, -1, false);
+ ctsvc_db_phone_log_update_person_id(NULL, person_id, -1, false, NULL);
#endif /* ENABLE_LOG_FEATURE */
} else {
ctsvc_set_person_noti();
#endif /* ENABLE_LOG_FEATURE */
} else {
ctsvc_set_person_noti();
"WHERE data.id = %d", number_id);
ret = ctsvc_query_get_first_int_result(query, &person_id);
if (0 < person_id)
"WHERE data.id = %d", number_id);
ret = ctsvc_query_get_first_int_result(query, &person_id);
if (0 < person_id)
- ctsvc_db_phone_log_update_person_id(number->number, -1, person_id, false);
+ ctsvc_db_phone_log_update_person_id(number->number, -1, person_id, false, NULL);
#endif /* ENABLE_LOG_FEATURE */
ctsvc_set_number_noti();
}
#endif /* ENABLE_LOG_FEATURE */
ctsvc_set_number_noti();
}
#ifdef ENABLE_LOG_FEATURE
/* update phone log */
if (0 < person_id && pre_number)
#ifdef ENABLE_LOG_FEATURE
/* update phone log */
if (0 < person_id && pre_number)
- ctsvc_db_phone_log_update_person_id(pre_number, person_id, -1, false);
+ ctsvc_db_phone_log_update_person_id(pre_number, person_id, -1, false, NULL);
- ctsvc_db_phone_log_update_person_id(number->number, -1, person_id, false);
+ ctsvc_db_phone_log_update_person_id(number->number, -1, person_id, false, NULL);
ctsvc_stmt_finalize(stmt);
#endif /* ENABLE_LOG_FEATURE */
} while (0);
ctsvc_stmt_finalize(stmt);
#endif /* ENABLE_LOG_FEATURE */
} while (0);
#ifdef ENABLE_LOG_FEATURE
/* update phone log */
if (0 < person_id && pre_number)
#ifdef ENABLE_LOG_FEATURE
/* update phone log */
if (0 < person_id && pre_number)
- ctsvc_db_phone_log_update_person_id(pre_number, person_id, -1, false);
+ ctsvc_db_phone_log_update_person_id(pre_number, person_id, -1, false, NULL);
ctsvc_stmt_finalize(stmt);
#endif /* ENABLE_LOG_FEATURE */
ctsvc_stmt_finalize(stmt);
#endif /* ENABLE_LOG_FEATURE */
ctsvc_stmt_finalize(stmt);
/* update phonelog */
ctsvc_stmt_finalize(stmt);
/* update phonelog */
- ctsvc_db_phone_log_update_person_id(phonelog->address, phonelog->person_id, -1, false);
+ ctsvc_db_phone_log_update_person_id(phonelog->address, phonelog->person_id, -1, false, &phonelog->person_id);
ctsvc_set_phonelog_noti();
return CONTACTS_ERROR_NONE;
ctsvc_set_phonelog_noti();
return CONTACTS_ERROR_NONE;