diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index 8495bbaee7ea17df575339264f9d1c2e137bc83a..3b929ee5f9a207ab69ac20b1d02fc0a51f408b27 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -1333,27 +1333,36 @@ void sflphone_fill_history (void) void sflphone_save_history (void) { - GQueue *items; gint size; - int i; - callable_obj_t *current; + gint i; + QueueElement *current; GHashTable *result = NULL; gchar *key, *value; - DEBUG ("SFLphone: Saving history ..."); + DEBUG ("SFLphone: Saving history"); result = g_hash_table_new (NULL, g_str_equal); - items = history->callQueue; size = calllist_get_size (history); - for (i=0; i<size; i++) { - current = g_queue_peek_nth (items, i); + for (i = 0; i < size; i++) { + current = calllist_get_nth (history, i); if (current) { - value = serialize_history_entry (current); - key = convert_timestamp_to_gchar (current->_time_start); - g_hash_table_replace (result, (gpointer) key, - (gpointer) value); + if(current->type == HIST_CALL) { + value = serialize_history_call_entry (current->elem.call); + key = convert_timestamp_to_gchar (current->elem.call->_time_start); + } + else if(current->type == HIST_CONFERENCE) { + value = serialize_history_conference_entry(current->elem.conf); + key = convert_timestamp_to_gchar (current->elem.conf->_time_start); + } + else { + ERROR("SFLphone: Error: Unknown type for serialization"); + } + g_hash_table_replace (result, (gpointer) key, (gpointer) value); + } + else { + WARN("SFLphone: Warning: %dth element is null", i); } } diff --git a/sflphone-client-gnome/src/callable_obj.c b/sflphone-client-gnome/src/callable_obj.c index ac116d00ed56b09c90d38e43590f827823cdbe0d..acb9b80b1504a3cc713dcb41a22bd6236dc1ab0c 100644 --- a/sflphone-client-gnome/src/callable_obj.c +++ b/sflphone-client-gnome/src/callable_obj.c @@ -455,7 +455,7 @@ gchar* get_call_duration (callable_obj_t *obj) } -gchar* serialize_history_entry (callable_obj_t *entry) +gchar* serialize_history_call_entry (callable_obj_t *entry) { // "0|514-276-5468|Savoir-faire Linux|144562458" for instance @@ -471,8 +471,6 @@ gchar* serialize_history_entry (callable_obj_t *entry) gchar* peer_name = (entry->_peer_name == NULL || g_strcasecmp (entry->_peer_name,"") == 0) ? "empty": entry->_peer_name; gchar* account_id = (entry->_accountID == NULL || g_strcasecmp (entry->_accountID,"") == 0) ? "empty": entry->_accountID; - DEBUG("ACCOUNT ID STORED IN HISTORY %s", account_id); - result = g_strconcat (history_state, separator, entry->_peer_number, separator, peer_name, separator, diff --git a/sflphone-client-gnome/src/callable_obj.h b/sflphone-client-gnome/src/callable_obj.h index 8cdd34da92952b3b4864ee95678c020ef6c01c59..db98a982769ba32bdbed752554abc9e709ca908b 100644 --- a/sflphone-client-gnome/src/callable_obj.h +++ b/sflphone-client-gnome/src/callable_obj.h @@ -223,7 +223,7 @@ history_state_t get_history_state_from_id (gchar *indice); gchar* get_call_duration (callable_obj_t *obj); -gchar* serialize_history_entry (callable_obj_t *entry); +gchar* serialize_history_call_entry(callable_obj_t *entry); gchar* get_history_id_from_state (history_state_t state); diff --git a/sflphone-client-gnome/src/conference_obj.c b/sflphone-client-gnome/src/conference_obj.c index 3649d996f6f5aafbb2576319e0f21cd0b622ea22..0daae8b912839625457fcc942af6392cc0a3a815 100644 --- a/sflphone-client-gnome/src/conference_obj.c +++ b/sflphone-client-gnome/src/conference_obj.c @@ -170,3 +170,8 @@ void conference_participant_list_update (gchar** participants, conference_obj_t* } } + +gchar *serialize_history_conference_entry(conference_obj_t *entry) +{ + return ""; +} diff --git a/sflphone-client-gnome/src/conference_obj.h b/sflphone-client-gnome/src/conference_obj.h index 20ec9e88475222ce2c534f93e8a820c221b9bfdc..01514c19d05457638324dfea009e18aeba956c96 100644 --- a/sflphone-client-gnome/src/conference_obj.h +++ b/sflphone-client-gnome/src/conference_obj.h @@ -88,4 +88,6 @@ GSList* conference_next_participant (GSList* participant); void conference_participant_list_update (gchar**, conference_obj_t*); +gchar *serialize_history_conference_entry(conference_obj_t *entry); + #endif diff --git a/sflphone-client-gnome/src/contacts/calllist.c b/sflphone-client-gnome/src/contacts/calllist.c index ad1858cf692e97b196b8736d6e128e06ca1c3b65..ab95bd03c64fc1209e14f66ed860d587538d4b7b 100644 --- a/sflphone-client-gnome/src/contacts/calllist.c +++ b/sflphone-client-gnome/src/contacts/calllist.c @@ -194,8 +194,6 @@ calllist_remove_call (calltab_t* tab, const gchar * callID) DEBUG("CallList: Remove call %s from list", callID); c = g_queue_find_custom (tab->callQueue, callID, is_callID_callstruct); - - // c = calllist_get_call (tab, callID); if(c == NULL) { DEBUG("CallList: Could not remove call %s", callID); return; diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c index 6a7b705d0c58200f99d822c0ef52b1726c65b36e..63bd16a1abdef5d59357638086dc23949d26730e 100644 --- a/sflphone-client-gnome/src/uimanager.c +++ b/sflphone-client-gnome/src/uimanager.c @@ -337,8 +337,6 @@ update_actions() WARN ("Should not happen in update_actions()!"); break; } - - DEBUG("ok"); } else if (selectedConf) { DEBUG("UIManager: Update actions for conference");