diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index 46e8ce2f93da78bc7c2efee7b7ae596d4f7ce070..4be631e4cd3c7bfccef393bcda5f3cb90e5245ec 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -547,8 +547,9 @@ sflphone_pick_up() calltree_update_call (history, selectedCall, NULL); // if instant messaging window is visible, create new tab (deleted automatically if not used) - if (im_window_is_visible()) + if (selectedCall->_im_widget && im_window_is_visible()) { im_widget_display ( (IMWidget **) (&selectedCall->_im_widget), NULL, selectedCall->_callID, NULL); + } dbus_accept (selectedCall); stop_notification(); @@ -1368,10 +1369,10 @@ void sflphone_fill_conference_list (void) void sflphone_fill_history (void) { - const gchar **entries; + const gchar **entries, **history_entries; gchar *current_entry; - callable_obj_t *history_entry; - callable_obj_t *call; + callable_obj_t *history_call, *call; + conference_obj_t *history_conf, *conf; QueueElement *element; guint i = 0, n = 0; @@ -1385,36 +1386,52 @@ void sflphone_fill_history (void) DEBUG("============================================ entry: %s", current_entry); - // do something with key and value - create_history_entry_from_serialized_form (current_entry, &history_entry); + if(g_str_has_prefix(current_entry, "9999")) { + // create a conference entry + create_conference_history_entry_from_serialized(current_entry, &history_conf); + + conf = conferencelist_get(history, history_conf->_confID); + if(conf == NULL) { + conferencelist_add(history, history_conf); + } + else { + conf->_recordfile = g_strdup(history_conf->_recordfile); + } + } + else { + + // do something with key and value + create_history_entry_from_serialized_form (current_entry, &history_call); - // Add it and update the GUI - calllist_add_call (history, history_entry); + // Add it and update the GUI + calllist_add_call (history, history_call); - if(history_entry->_confID && g_strcmp0(history_entry->_confID, "") != 0) { - conference_obj_t *conf; + if(history_call->_confID && g_strcmp0(history_call->_confID, "") != 0) { - DEBUG("----------------- conf id: %s", history_entry->_confID); + DEBUG("----------------- conf id: %s", history_call->_confID); - // process conference - conf = conferencelist_get(history, history_entry->_confID); - if(conf == NULL) { - // conference does not exist yet, create it - create_new_conference(CONFERENCE_STATE_ACTIVE_ATACHED, history_entry->_confID, &conf); - conferencelist_add(history, conf); - } + // process conference + conf = conferencelist_get(history, history_call->_confID); + if(conf == NULL) { + // conference does not exist yet, create it + create_new_conference(CONFERENCE_STATE_ACTIVE_ATACHED, history_call->_confID, &conf); + conferencelist_add(history, conf); + } - conference_add_participant(history_entry->_callID, conf); + conference_add_participant(history_call->_callID, conf); - // conference start timestamp corespond to - if(conf->_time_start > history_entry->_time_added) { - conf->_time_start = history_entry->_time_added; - } + // conference start timestamp corespond to + if(conf->_time_start > history_call->_time_added) { + conf->_time_start = history_call->_time_added; + } + } } entries++; } + entries = history_entries; + // fill n = calllist_get_size(history); DEBUG("CALL SIZE: %d", n); @@ -1445,6 +1462,7 @@ void sflphone_save_history (void) gint size; gint i; QueueElement *current; + conference_obj_t *conf; GHashTable *result = NULL; gchar **ordered_result; gchar *key, *value; @@ -1455,7 +1473,6 @@ void sflphone_save_history (void) g_hash_table_ref (result); size = calllist_get_size (history); - for (i = 0; i < size; i++) { current = calllist_get_nth (history, i); @@ -1482,6 +1499,20 @@ void sflphone_save_history (void) } } + size = conferencelist_get_size(history); + for(i = 0; i < size; i++) { + conf = conferencelist_get_nth(history, i); + if(conf == NULL) { + DEBUG("SFLphone: Error: Could not get %dth conference", i); + break; + } + value = serialize_history_conference_entry(conf); + key = convert_timestamp_to_gchar(conf->_time_start); + + g_hash_table_replace(result, (gpointer) key, + g_slist_append(g_hash_table_lookup(result, key), (gpointer) value)); + } + sflphone_order_history_hash_table(result, &ordered_result); gchar **testprnt = ordered_result; diff --git a/sflphone-client-gnome/src/conference_obj.c b/sflphone-client-gnome/src/conference_obj.c index 107fb10b8ef771cd3728350462739cb36d20251f..015365fc4dd3def6c4b55c40906393415ea0f232 100644 --- a/sflphone-client-gnome/src/conference_obj.c +++ b/sflphone-client-gnome/src/conference_obj.c @@ -260,7 +260,7 @@ gchar *serialize_history_conference_entry(conference_obj_t *entry) DEBUG("Conference: Participant number: %s, concatenation: %s", tmp, participantstr); } - result = g_strconcat("2188", separator, + result = g_strconcat("9999", separator, participantstr, separator, // peer number peer_name, separator, time_start, separator, @@ -274,7 +274,7 @@ gchar *serialize_history_conference_entry(conference_obj_t *entry) return result; } -void create_conference_history_entry_from_serialized(gchar **ptr, conference_obj_t **conf) +void create_conference_history_entry_from_serialized(gchar *entry, conference_obj_t **conf) { history_state_t history_state = MISSED; gint token = 0; @@ -286,9 +286,12 @@ void create_conference_history_entry_from_serialized(gchar **ptr, conference_obj gchar *accountID = ""; gchar *recordfile = ""; const gchar *confID = ""; + gchar **ptr; + gchar *delim = "|"; DEBUG("Conference: Create a conference from serialized form"); + ptr = g_strsplit(entry, delim, 8); while(ptr != NULL && token < 8) { switch(token) { case 0: @@ -326,7 +329,7 @@ void create_conference_history_entry_from_serialized(gchar **ptr, conference_obj // create a new empty conference create_new_conference(state, confID, conf); - process_conference_participant_from_serialized(participant, *conf); + // process_conference_participant_from_serialized(participant, *conf); g_free(participant); } diff --git a/sflphone-client-gnome/src/conference_obj.h b/sflphone-client-gnome/src/conference_obj.h index 02208140ed81d35491aa6275ab1f91e55379cce4..927db5a42d53a548ad3a3a681ca07f10b4c80e92 100644 --- a/sflphone-client-gnome/src/conference_obj.h +++ b/sflphone-client-gnome/src/conference_obj.h @@ -56,7 +56,6 @@ typedef enum { * This struct holds information about a conference. */ typedef struct { - conference_state_t _state; // The state of the call gchar *_confID; // The call ID gboolean _conference_secured; // the security state of the conference @@ -87,6 +86,6 @@ void conference_participant_list_update (gchar**, conference_obj_t*); gchar *serialize_history_conference_entry(conference_obj_t *entry); -void create_conference_history_entry_from_serialized(gchar **, conference_obj_t **); +void create_conference_history_entry_from_serialized(gchar *, conference_obj_t **); #endif diff --git a/sflphone-client-gnome/src/uimanager.c b/sflphone-client-gnome/src/uimanager.c index cbf31411c878d7fabacd5e2fe4a1f3e4515fde1e..1ef277a1cadf87035fec33e510a8fbe6abec52e8 100644 --- a/sflphone-client-gnome/src/uimanager.c +++ b/sflphone-client-gnome/src/uimanager.c @@ -384,6 +384,15 @@ update_actions() gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (imToolbar), 4); } } + else if(active_calltree == history) { + if(selectedConf->_recordfile && (g_strcmp0(selectedConf->_recordfile, "") != 0)) { + if(selectedConf->_record_is_playing) + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM(stopRecordWidget), 3); + else + gtk_toolbar_insert(GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM(playRecordWidget), 3); + } + + } break; case CONFERENCE_STATE_ACTIVE_ATTACHED_RECORD: case CONFERENCE_STATE_ACTIVE_DETACHED_RECORD: diff --git a/sflphone-common/src/history/historyitem.cpp b/sflphone-common/src/history/historyitem.cpp index 39c369577a6bb2c245ef2189c6b732edee093431..9a6d2647193c67bfe6c4bca0a69b7a7cbc210084 100644 --- a/sflphone-common/src/history/historyitem.cpp +++ b/sflphone-common/src/history/historyitem.cpp @@ -150,6 +150,7 @@ bool HistoryItem::save (Conf::ConfigTree **history) sectionstr = section.str(); _error("-- Unserialized type: %s", call_type.str().c_str()); + /* _error("-- Unserialized time start: %s", _timestamp_start.c_str()); _error("-- Unserialized time stop: %s", _timestamp_stop.c_str()); _error("-- Unserialized number: %s", _number.c_str()); @@ -159,7 +160,7 @@ bool HistoryItem::save (Conf::ConfigTree **history) _error("-- Unserialized record file: %s", _recording_file.c_str()); _error("-- Unserialized conference id:%s", _confID.c_str()); _error("-- Unserialized time added: %s", _timeAdded.c_str()); - + */ res = ( (*history)->setConfigTreeItem (sectionstr, "type", call_type.str()) && (*history)->setConfigTreeItem (sectionstr, "timestamp_start", _timestamp_start) @@ -171,7 +172,6 @@ bool HistoryItem::save (Conf::ConfigTree **history) && (*history)->setConfigTreeItem (sectionstr, "recordfile", _recording_file) && (*history)->setConfigTreeItem (sectionstr, "confid", _confID) && (*history)->setConfigTreeItem (sectionstr, "timeadded", _timeAdded)); - return res; }