Commit d4b64d2b authored by Tristan Matthews's avatar Tristan Matthews

Merge branch 'no_globals_in_calltree_experiment' of...

Merge branch 'no_globals_in_calltree_experiment' of git+ssh://git.sflphone.org/var/repos/sflphone/git/sflphone into no_globals_in_calltree_experiment
parents 8f3d63e0 c54eb29c
......@@ -183,11 +183,6 @@ sflphone_hung_up(callable_obj_t * c)
call_remove_all_errors(c);
update_actions();
if (c->_confID) {
g_free(c->_confID);
c->_confID = NULL;
}
// test whether the widget contains text, if not remove it
if ((im_window_get_nb_tabs() > 1) && c->_im_widget && !(IM_WIDGET(c->_im_widget)->containText))
im_window_remove_tab(c->_im_widget);
......@@ -613,8 +608,12 @@ sflphone_new_call()
callable_obj_t *current_selected_call = calltab_get_selected_call(current_calls_tab);
if ((current_selected_call != NULL) && (current_selected_call->_confID == NULL))
sflphone_on_hold();
if (current_selected_call != NULL) {
gchar *confID = dbus_get_conference_id(current_selected_call->_callID);
if(g_strcmp0(confID, "") != 0) {
sflphone_on_hold();
}
}
// Play a tone when creating a new call
if (calllist_get_size(current_calls_tab) == 0)
......@@ -813,11 +812,6 @@ sflphone_detach_participant(const gchar* callID)
DEBUG("Detach participant %s", selectedCall->_callID);
if (selectedCall->_confID) {
g_free(selectedCall->_confID);
selectedCall->_confID = NULL;
}
im_widget_update_state(IM_WIDGET(selectedCall->_im_widget), TRUE);
calltree_remove_call(current_calls_tab, selectedCall->_callID);
calltree_add_call(current_calls_tab, selectedCall, NULL);
......@@ -946,20 +940,23 @@ void sflphone_fill_codec_list_per_account(account_t *account)
void sflphone_fill_call_list(void)
{
gchar **list = dbus_get_call_list();
gchar **call_list = dbus_get_call_list();
for (gchar **calls = list; calls && *calls; ++calls) {
gchar *callID = *calls;
for (gchar **callp = call_list; callp && *callp; ++callp) {
gchar *callID = *callp;
if (!calllist_get_call(current_calls_tab, callID)) {
callable_obj_t *c = create_new_call_from_details(*calls, dbus_get_call_details(*calls));
c->_zrtp_confirmed = FALSE;
calllist_add_call(current_calls_tab, c);
if (!c->_confID || strlen(c->_confID) == 0)
calltree_add_call(current_calls_tab, c, NULL);
callable_obj_t *call = create_new_call_from_details(*callp, dbus_get_call_details(*callp));
call->_zrtp_confirmed = FALSE;
calllist_add_call(current_calls_tab, call);
// add in treeview only if does not participate to a conference
gchar *confID = dbus_get_conference_id(call->_callID);
if(g_strcmp0(confID, "") == 0)
calltree_add_call(current_calls_tab, call, NULL);
}
}
g_strfreev(list);
g_strfreev(call_list);
}
......
......@@ -146,7 +146,6 @@ callable_obj_t *create_new_call_from_details(const gchar *call_id, GHashTable *d
const gchar * const peer_number = g_hash_table_lookup(details, "PEER_NUMBER");
const gchar * const display_name = g_hash_table_lookup(details, "DISPLAY_NAME");
const gchar * const state_str = g_hash_table_lookup(details, "CALL_STATE");
const gchar * const conf_id = g_hash_table_lookup(details, "CONF_ID");
if (utf8_case_equal(state_str, "CURRENT"))
state = CALL_STATE_CURRENT;
......@@ -163,7 +162,6 @@ callable_obj_t *create_new_call_from_details(const gchar *call_id, GHashTable *d
gchar *number = call_get_peer_number(peer_number);
callable_obj_t *c = create_new_call(CALL, state, call_id, accountID, display_name, number);
c->_confID = g_strdup(conf_id);
g_free(number);
return c;
}
......@@ -199,8 +197,7 @@ callable_obj_t *create_history_entry_from_hashtable(GHashTable *entry)
value = g_hash_table_lookup(entry, TIMESTAMP_STOP_KEY);
new_call->_time_stop = value ? atoi(value) : 0;
new_call->_recordfile = g_strdup(g_hash_table_lookup(entry, RECORDING_PATH_KEY));
new_call->_confID = g_strdup(g_hash_table_lookup(entry, CONFID_KEY));
new_call->_historyConfID = g_strdup(new_call->_confID);
new_call->_historyConfID = g_strdup(g_hash_table_lookup(entry, CONFID_KEY));
new_call->_record_is_playing = FALSE;
return new_call;
......@@ -209,7 +206,6 @@ callable_obj_t *create_history_entry_from_hashtable(GHashTable *entry)
void free_callable_obj_t (callable_obj_t *c)
{
g_free(c->_callID);
g_free(c->_confID);
g_free(c->_historyConfID);
g_free(c->_accountID);
g_free(c->_srtp_cipher);
......
......@@ -96,7 +96,7 @@ typedef struct {
int _state_code; // The numeric state code as defined in SIP or IAX
gchar* _state_code_description; // A textual description of _state_code
gchar* _callID; // The call ID
gchar* _confID; // The conference ID (NULL if don't participate to a conference)
// gchar* _confID; // The conference ID (NULL if don't participate to a conference)
gchar* _historyConfID; // Persistent conf id to be stored in history
gchar* _accountID; // The account the call is made with
time_t _time_start; // The timestamp the call was initiating
......
......@@ -143,16 +143,6 @@ void conference_participant_list_update(gchar** participants, conference_obj_t*
return;
}
for (gchar **part = participants; part && *part; ++part) {
const gchar *call_id = (const gchar *) (*part);
callable_obj_t *call = calllist_get_call(current_calls_tab, call_id);
if (call) {
g_free(call->_confID);
call->_confID = NULL;
}
}
if (conf->participant_list) {
g_slist_free(conf->participant_list);
conf->participant_list = NULL;
......@@ -165,7 +155,6 @@ void conference_participant_list_update(gchar** participants, conference_obj_t*
restore_call(call_id);
call = calllist_get_call(current_calls_tab, call_id);
}
call->_confID = g_strdup(conf->_confID);
conference_add_participant(call_id, conf);
}
}
......
......@@ -338,7 +338,6 @@ conference_created_cb(DBusGProxy *proxy UNUSED, const gchar *confID, void *foo U
if (call->_state == CALL_STATE_RECORD)
new_conf->_state = CONFERENCE_STATE_ACTIVE_ATTACHED_RECORD;
call->_confID = g_strdup(confID);
call->_historyConfID = g_strdup(confID);
}
......@@ -365,8 +364,6 @@ conference_removed_cb(DBusGProxy *proxy UNUSED, const gchar *confID,
callable_obj_t *call = calllist_get_call(current_calls_tab, p->data);
if (call) {
g_free(call->_confID);
call->_confID = NULL;
im_widget_update_state(IM_WIDGET(call->_im_widget), TRUE);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment