Commit 367e26d8 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#2926] Code Cleanup

parent a36aa008
......@@ -140,11 +140,11 @@ GSList* conference_participant_list_update(gchar** participants, conference_obj_
conf->participant_list = NULL;
}
DEBUG("conference_participant_list_update\n");
DEBUG("Conference: Participant list update");
for (part = participants; *part; part++) {
call_id = (gchar*)(*part);
DEBUG(" adding %s", call_id);
DEBUG("Adding %s", call_id);
conference_add_participant(call_id, conf);
}
......
......@@ -1042,7 +1042,7 @@ void calltree_add_history_entry (callable_obj_t * c)
void calltree_add_conference (calltab_t* tab, conference_obj_t* conf)
{
DEBUG("calltree_add_conference conf->_confID %s\n", conf->_confID);
DEBUG("Calltree: Add conference %s", conf->_confID);
GdkPixbuf *pixbuf=NULL;
GdkPixbuf *pixbuf_security=NULL;
......@@ -1066,7 +1066,7 @@ void calltree_add_conference (calltab_t* tab, conference_obj_t* conf)
if(!conf) {
DEBUG("Error conference is null!!");
ERROR("Calltree: Error: Conference is null!!");
return;
}
......@@ -1075,14 +1075,9 @@ void calltree_add_conference (calltab_t* tab, conference_obj_t* conf)
gtk_tree_store_append (tab->store, &iter, NULL);
// _debug
if( tab == current_calls )
{
if(!(conf->_state))
DEBUG("Error conf->_state is NULL");
switch(conf->_state)
{
case CONFERENCE_STATE_ACTIVE_ATACHED:
......@@ -1127,14 +1122,14 @@ void calltree_add_conference (calltab_t* tab, conference_obj_t* conf)
// Every participant to a conference must be secured, the conference is not secured elsewhere
conf->_conference_secured = TRUE;
DEBUG("Determine if conference is secured");
DEBUG("Calltree: Determine if conference is secured");
// participant = conf->participant;
// participant = dbus_get_participant_list(conf->_confID);
conference_participant = conf->participant_list;
if(conference_participant) {
DEBUG(" determine if at least one participant uses srtp");
DEBUG("Calltree: Determine if at least one participant uses SRTP");
// participant = conf->participant;
// participant = dbus_get_participant_list(conf->_confID);
......@@ -1153,12 +1148,12 @@ void calltree_add_conference (calltab_t* tab, conference_obj_t* conf)
}
if(g_strcasecmp(srtp_enabled,"true") == 0) {
DEBUG(" srtp enabled for participant %s\n", call_id);
DEBUG("Calltree: SRTP enabled for participant %s", call_id);
conf->_conf_srtp_enabled = TRUE;
break;
}
else {
DEBUG(" srtp is not enabled for participant %s\n", call_id);
DEBUG("Calltree: SRTP is not enabled for participant %s", call_id);
}
}
......@@ -1167,7 +1162,7 @@ void calltree_add_conference (calltab_t* tab, conference_obj_t* conf)
}
DEBUG(" determine if all conference participant are secured");
DEBUG("Calltree: Determine if all conference participant are secured");
if(conf->_conf_srtp_enabled) {
// participant = conf->participant;
......@@ -1181,12 +1176,12 @@ void calltree_add_conference (calltab_t* tab, conference_obj_t* conf)
if(call != NULL) {
if(call->_srtp_state == 0) {
DEBUG(" participant %s is not secured", call_id);
DEBUG("Calltree: Participant %s is not secured", call_id);
conf->_conference_secured = FALSE;
break;
}
else {
DEBUG(" participant %s is secured", call_id);
DEBUG("Calltree: Participant %s is secured", call_id);
}
}
conference_participant = conference_next_participant(conference_participant);
......@@ -1196,16 +1191,16 @@ void calltree_add_conference (calltab_t* tab, conference_obj_t* conf)
if(conf->_conf_srtp_enabled) {
if(conf->_conference_secured) {
DEBUG("Conference is secured");
DEBUG("Calltree: Conference is secured");
pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_confirmed.svg", NULL);
}
else {
DEBUG("Conference is not secured");
DEBUG("Calltree: Conference is not secured");
pixbuf_security = gdk_pixbuf_new_from_file(ICONS_DIR "/lock_off.svg", NULL);
}
}
DEBUG("add conference to tree store");
DEBUG("Calltree: Add conference to tree store");
gtk_tree_store_set(tab->store, &iter,
0, pixbuf, // Icon
......@@ -1222,11 +1217,11 @@ void calltree_add_conference (calltab_t* tab, conference_obj_t* conf)
conference_participant = conf->participant_list;
if(conference_participant) {
DEBUG("Add conference participants\n");
DEBUG("Calltre: Adding conference participant");
// for (pl = participant; *pl; pl++)
while(conference_participant) {
DEBUG("OK");
call_id = (gchar*)(conference_participant->data);
call = calllist_get (tab, call_id);
// create_new_call_from_details (conf_id, conference_details, &c);
......@@ -1244,14 +1239,13 @@ void calltree_add_conference (calltab_t* tab, conference_obj_t* conf)
}
*/
gtk_tree_view_set_model(GTK_TREE_VIEW(tab->view), GTK_TREE_MODEL(tab->store));
gtk_tree_view_set_model(GTK_TREE_VIEW(tab->view), GTK_TREE_MODEL(tab->store));
path = gtk_tree_model_get_path(model, &iter);
path = gtk_tree_model_get_path(model, &iter);
gtk_tree_view_expand_row(GTK_TREE_VIEW(tab->view), path, FALSE);
update_actions();
update_actions();
}
......
......@@ -258,7 +258,7 @@ conference_changed_cb(DBusGProxy *proxy UNUSED, const gchar* confID,
static void
conference_created_cb(DBusGProxy *proxy UNUSED, const gchar* confID, void * foo UNUSED )
{
DEBUG ("Conference added %s\n", confID);
DEBUG ("DBUS: Conference %s added", confID);
conference_obj_t* new_conf;
callable_obj_t* call;
......@@ -267,15 +267,14 @@ conference_created_cb(DBusGProxy *proxy UNUSED, const gchar* confID, void * foo
gchar** part;
create_new_conference(CONFERENCE_STATE_ACTIVE_ATACHED, confID, &new_conf);
// new_conf->_confID = g_strdup(confID);
participants = (gchar**) dbus_get_participant_list(new_conf->_confID);
// Update conference list
conference_participant_list_update(participants, new_conf);
// participant = new_conf->participant;
for (part = participants; *part; part++)
{
// Add conference ID in in each calls
for (part = participants; *part; part++) {
call_id = (gchar*) (*part);
call = calllist_get(current_calls, call_id);
call->_confID = g_strdup(confID);
......@@ -2159,12 +2158,12 @@ dbus_get_conference_list(void)
}
gchar**
dbus_get_participant_list(const char * confID)
dbus_get_participant_list(const char *confID)
{
GError *error = NULL;
gchar **list = NULL;
DEBUG("get participant list")
DEBUG("DBUS: Get conference %s participant list", confID);
org_sflphone_SFLphone_CallManager_get_participant_list(callManagerProxy,
confID, &list, &error);
......
......@@ -77,21 +77,21 @@ CallManager::placeCallFirstAccount (const std::string& callID,
void
CallManager::refuse (const std::string& callID)
{
_debug ("CallManager: refuse received");
_debug ("CallManager: Refuse %s", callID.c_str());
Manager::instance().refuseCall (callID);
}
void
CallManager::accept (const std::string& callID)
{
_debug ("CallManager: accept received");
_debug ("CallManager: Accept received");
Manager::instance().answerCall (callID);
}
void
CallManager::hangUp (const std::string& callID)
{
_debug ("CallManager::hangUp received %s", callID.c_str());
_debug ("CallManager: HangUp received %s", callID.c_str());
Manager::instance().hangupCall (callID);
}
......@@ -202,7 +202,7 @@ CallManager::holdConference (const std::string& confID)
void
CallManager::unholdConference (const std::string& confID)
{
_debug ("CallManager::unHoldConference received %s", confID.c_str());
_debug ("CallManager: Unhold Conference %s", confID.c_str());
Manager::instance().unHoldConference (confID);
}
......@@ -221,6 +221,7 @@ CallManager::getConferenceList (void)
std::vector< std::string >
CallManager::getParticipantList (const std::string& confID)
{
_debug("CallManager: Get Participant list for conference %s", confID.c_str());
return Manager::instance().getParticipantList (confID);
}
......
......@@ -725,6 +725,9 @@ ManagerImpl::createConference (const CallID& id1, const CallID& id2) {
conf->add(id1);
conf->add(id2);
// Add conference to map
_conferencemap.insert( std::pair<CallID, Conference*>(conf->getConfID(), conf));
// broadcast a signal over dbus
_dbus->getCallManager()->conferenceCreated(conf->getConfID());
......@@ -793,7 +796,7 @@ ManagerImpl::getConferenceFromCallID (const CallID& call_id) {
}
void ManagerImpl::holdConference (const CallID& id) {
_debug ("ManagerImpl: holdConference()");
_debug ("Manager: Hold conference()");
Conference *conf;
ConferenceMap::iterator iter_conf = _conferencemap.find(id);
......@@ -831,7 +834,7 @@ void ManagerImpl::holdConference (const CallID& id) {
void ManagerImpl::unHoldConference (const CallID& id) {
_debug ("ManagerImpl::unHoldConference()");
_debug ("Manager: Unhold conference()");
Conference *conf;
ConferenceMap::iterator iter_conf = _conferencemap.find(id);
......@@ -898,9 +901,8 @@ bool ManagerImpl::participToConference (const CallID& call_id) {
}
}
void ManagerImpl::addParticipant (const CallID& call_id,
const CallID& conference_id) {
_debug ("ManagerImpl::addParticipant(%s, %s)", call_id.c_str(), conference_id.c_str());
void ManagerImpl::addParticipant (const CallID& call_id, const CallID& conference_id) {
_debug ("ManagerImpl: Add participant %s to %s", call_id.c_str(), conference_id.c_str());
std::map<std::string, std::string> call_details = getCallDetails(call_id);
......@@ -1037,8 +1039,6 @@ void ManagerImpl::joinParticipant (const CallID& call_id1, const CallID& call_id
_debug ("Manager: Join participants %s, %s", call_id1.c_str(), call_id2.c_str());
std::map<std::string, std::string> call1_details = getCallDetails(call_id1);
std::map<std::string, std::string> call2_details = getCallDetails(call_id2);
......@@ -1127,7 +1127,7 @@ void ManagerImpl::joinParticipant (const CallID& call_id1, const CallID& call_id
void ManagerImpl::detachParticipant (const CallID& call_id,
const CallID& current_id) {
_debug ("ManagerImpl::detachParticipant(%s)", call_id.c_str());
_debug ("Manager: Detach participant %s", call_id.c_str());
CallID current_call_id = current_id;
......@@ -4302,7 +4302,8 @@ std::vector<std::string> ManagerImpl::getConferenceList (void) {
std::vector<std::string> ManagerImpl::getParticipantList (
const std::string& confID) {
_debug ("ManagerImpl::getParticipantList");
_debug ("ManagerImpl: Get participant list %s", confID.c_str());
std::vector<std::string> v;
ConferenceMap::iterator iter_conf = _conferencemap.find(confID);
......@@ -4322,6 +4323,9 @@ std::vector<std::string> ManagerImpl::getParticipantList (
iter_participant++;
}
}
else {
_warn("Manager: Warning: Did not found conference %s", confID.c_str());
}
return v;
}
......
Supports Markdown
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