summaryrefslogtreecommitdiff
path: root/native/ctsvc_db_plugin_activity.c
diff options
context:
space:
mode:
Diffstat (limited to 'native/ctsvc_db_plugin_activity.c')
-rw-r--r--native/ctsvc_db_plugin_activity.c38
1 files changed, 27 insertions, 11 deletions
diff --git a/native/ctsvc_db_plugin_activity.c b/native/ctsvc_db_plugin_activity.c
index 960efaf..bdfc9b7 100644
--- a/native/ctsvc_db_plugin_activity.c
+++ b/native/ctsvc_db_plugin_activity.c
@@ -116,9 +116,10 @@ static int __ctsvc_db_activity_insert_record( contacts_record_h record, int *id
}
snprintf(query, sizeof(query), "INSERT INTO "CTS_TABLE_ACTIVITIES"("
- "contact_id, source_name, status, timestamp, sync_data1, sync_data2, "
- "sync_data3, sync_data4) "
- "VALUES(%d, ?, ?, %d, ?, ?, ?, ?)",
+ "contact_id, source_name, status, timestamp, "
+ "service_operation, uri, "
+ "sync_data1, sync_data2, sync_data3, sync_data4) "
+ "VALUES(%d, ?, ?, %d, ?, ?, ?, ?, ?, ?)",
activity->contact_id, activity->timestamp);
stmt = cts_query_prepare(query);
@@ -132,14 +133,18 @@ static int __ctsvc_db_activity_insert_record( contacts_record_h record, int *id
cts_stmt_bind_text(stmt, 1, activity->source_name);
if (activity->status)
cts_stmt_bind_text(stmt, 2, activity->status);
+ if (activity->service_operation)
+ cts_stmt_bind_text(stmt, 3, activity->service_operation);
+ if (activity->uri)
+ cts_stmt_bind_text(stmt, 4, activity->uri);
if (activity->sync_data1)
- cts_stmt_bind_text(stmt, 3, activity->sync_data1);
+ cts_stmt_bind_text(stmt, 5, activity->sync_data1);
if (activity->sync_data2)
- cts_stmt_bind_text(stmt, 4, activity->sync_data2);
+ cts_stmt_bind_text(stmt, 6, activity->sync_data2);
if (activity->sync_data3)
- cts_stmt_bind_text(stmt, 5, activity->sync_data3);
+ cts_stmt_bind_text(stmt, 7, activity->sync_data3);
if (activity->sync_data4)
- cts_stmt_bind_text(stmt, 6, activity->sync_data4);
+ cts_stmt_bind_text(stmt, 8, activity->sync_data4);
ret = cts_stmt_step(stmt);
if (CONTACTS_ERROR_NONE != ret) {
@@ -221,6 +226,10 @@ static int __ctsvc_db_activity_value_set(cts_stmt stmt, contacts_record_h *recor
activity->status = SAFE_STRDUP(temp);
activity->timestamp = ctsvc_stmt_get_int(stmt, i++);
temp = ctsvc_stmt_get_text(stmt, i++);
+ activity->service_operation = SAFE_STRDUP(temp);
+ temp = ctsvc_stmt_get_text(stmt, i++);
+ activity->uri = SAFE_STRDUP(temp);
+ temp = ctsvc_stmt_get_text(stmt, i++);
activity->sync_data1 = SAFE_STRDUP(temp);
temp = ctsvc_stmt_get_text(stmt, i++);
activity->sync_data2 = SAFE_STRDUP(temp);
@@ -275,7 +284,8 @@ static int __ctsvc_db_activity_get_record( int id, contacts_record_h* out_record
contacts_record_h record;
snprintf(query, sizeof(query), "SELECT id, contact_id, source_name, status, "
- "timestamp, sync_data1, sync_data2, sync_data3, sync_data4 "
+ "timestamp, service_operation, uri, "
+ "sync_data1, sync_data2, sync_data3, sync_data4 "
"FROM "CTSVC_DB_VIEW_ACTIVITY" WHERE id = %d", id);
stmt = cts_query_prepare(query);
@@ -352,9 +362,7 @@ static int __ctsvc_db_activity_get_all_records( int offset, int limit,
contacts_list_h list;
len = snprintf(query, sizeof(query),
- "SELECT id, contact_id, source_name, status, "
- "timestamp, sync_data1, sync_data2, sync_data3, sync_data4 "
- "FROM "CTSVC_DB_VIEW_ACTIVITY);
+ "SELECT id FROM "CTSVC_DB_VIEW_ACTIVITY);
if (0 < limit) {
len += snprintf(query+len, sizeof(query)-len, " LIMIT %d", limit);
@@ -478,6 +486,14 @@ static int __ctsvc_db_activity_get_records_with_query( contacts_query_h query, i
case CTSVC_PROPERTY_ACTIVITY_TIMESTAMP:
activity->timestamp = ctsvc_stmt_get_int(stmt, i);
break;
+ case CTSVC_PROPERTY_ACTIVITY_SERVICE_OPERATION:
+ temp = ctsvc_stmt_get_text(stmt, i);
+ activity->service_operation = SAFE_STRDUP(temp);
+ break;
+ case CTSVC_PROPERTY_ACTIVITY_URI:
+ temp = ctsvc_stmt_get_text(stmt, i);
+ activity->uri = SAFE_STRDUP(temp);
+ break;
case CTSVC_PROPERTY_ACTIVITY_SYNC_DATA1:
temp = ctsvc_stmt_get_text(stmt, i);
activity->sync_data1 = SAFE_STRDUP(temp);