From 56445be4fff296fd1e90d1960d973d614bd50bf8 Mon Sep 17 00:00:00 2001 From: Alexandre Savard <alexandresavard@msavard.(none)> Date: Tue, 21 Jun 2011 19:08:59 -0400 Subject: [PATCH] #6233: Fix serialized account list terminated with a ";" character --- sflphone-client-gnome/src/conference_obj.c | 15 +++++++++------ sflphone-common/src/managerimpl.cpp | 2 ++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/sflphone-client-gnome/src/conference_obj.c b/sflphone-client-gnome/src/conference_obj.c index 6212ee46ce..cf80cc3738 100644 --- a/sflphone-client-gnome/src/conference_obj.c +++ b/sflphone-client-gnome/src/conference_obj.c @@ -76,6 +76,8 @@ void create_new_conference (conference_state_t state, const gchar* confID, confe new_conf->participant_list = NULL; new_conf->participant_number = NULL; + set_conference_timestamp(&new_conf->_time_start); + *conf = new_conf; } @@ -259,7 +261,7 @@ void create_conference_history_entry_from_serialized(gchar *timestamp, gchar **p gchar *time_stop = ""; gchar *accountID = ""; gchar *recordfile = ""; - const gchar *confID = "conf_1234"; + const gchar *confID = generate_call_id(); DEBUG("Conference: Create a conference from serialized form"); @@ -310,7 +312,7 @@ static void process_conference_participant_from_serialized(gchar *participant, c gint tok = 0; - DEBUG("------------------------------- process_conference_participant_from_serialized"); + DEBUG("Conference: Process participant from serialized form"); ptr = g_strsplit(participant, delim, 2); while(ptr != NULL && (tok < 2)) { @@ -318,9 +320,7 @@ static void process_conference_participant_from_serialized(gchar *participant, c gchar *account = NULL; token = 0; numberaccount = *ptr; - DEBUG("HERE IS THE PROBLEM"); numberptr = g_strsplit(numberaccount, delimnumber, 2); - DEBUG("problem !!!"); while(numberptr != NULL && (token < 2)) { switch(token) { case 0: @@ -328,6 +328,11 @@ static void process_conference_participant_from_serialized(gchar *participant, c break; case 1: account = *numberptr; + int len = strlen(account); + if(g_str_has_suffix(account, ";")) { + gchar *tmpchar = g_strdup(account); + g_strlcpy(account, tmpchar, len); + } break; default: break; @@ -346,9 +351,7 @@ static void process_conference_participant_from_serialized(gchar *participant, c calllist_add_history_call(tmp_call); calllist_add_call(current_calls, tmp_call); - DEBUG("BEFORE %s", call_id); conference_add_participant(call_id, conf); - DEBUG("AFTER"); ptr++; } diff --git a/sflphone-common/src/managerimpl.cpp b/sflphone-common/src/managerimpl.cpp index 9dc000fe69..3cfa981f5f 100644 --- a/sflphone-common/src/managerimpl.cpp +++ b/sflphone-common/src/managerimpl.cpp @@ -1337,6 +1337,8 @@ void ManagerImpl::createConfFromParticipantList(const std::vector< std::string > // Manager methods may behave differently if the call id particip to a conference conf->add(generatedCallID); + switchCall(""); + // Create call callSuccess = outgoingCall(account, generatedCallID, tostr, conf->getConfID()); -- GitLab