From dc80dafdbd73a491e730c23f0fc35c235237ada3 Mon Sep 17 00:00:00 2001 From: Tristan Matthews <tristan.matthews@savoirfairelinux.com> Date: Fri, 24 May 2013 14:15:15 -0400 Subject: [PATCH] * #24789: callmanager: return bool in joinParticipants --- daemon/src/dbus/callmanager-introspec.xml | 1 + daemon/src/dbus/callmanager.cpp | 7 ++++--- daemon/src/dbus/callmanager.h | 2 +- daemon/src/managerimpl.cpp | 11 ++++++----- daemon/src/managerimpl.h | 3 ++- gnome/src/dbus/callmanager-introspec.xml | 1 + gnome/src/dbus/dbus.c | 4 +++- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/daemon/src/dbus/callmanager-introspec.xml b/daemon/src/dbus/callmanager-introspec.xml index ea9e3c76da..946fce25e5 100644 --- a/daemon/src/dbus/callmanager-introspec.xml +++ b/daemon/src/dbus/callmanager-introspec.xml @@ -242,6 +242,7 @@ </tp:docstring> <arg type="s" name="sel_callID" direction="in"/> <arg type="s" name="drag_callID" direction="in"/> + <arg type="b" name="joinSucceeded" direction="out"/> </method> <method name="createConfFromParticipantList" tp:name-for-bindings="createConfFromParticipantList"> diff --git a/daemon/src/dbus/callmanager.cpp b/daemon/src/dbus/callmanager.cpp index cd26482769..b92fddeb36 100644 --- a/daemon/src/dbus/callmanager.cpp +++ b/daemon/src/dbus/callmanager.cpp @@ -170,10 +170,11 @@ CallManager::getVolume(const std::string& device) return 0; } -void -CallManager::joinParticipant(const std::string& sel_callID, const std::string& drag_callID) +bool +CallManager::joinParticipant(const std::string& sel_callID, + const std::string& drag_callID) { - Manager::instance().joinParticipant(sel_callID, drag_callID); + return Manager::instance().joinParticipant(sel_callID, drag_callID); } void diff --git a/daemon/src/dbus/callmanager.h b/daemon/src/dbus/callmanager.h index 445cc23512..d8a70c3476 100644 --- a/daemon/src/dbus/callmanager.h +++ b/daemon/src/dbus/callmanager.h @@ -88,7 +88,7 @@ class CallManager bool isValidCall(const std::string &callID); /* Conference related methods */ - void joinParticipant(const std::string& sel_callID, const std::string& drag_callID); + bool joinParticipant(const std::string& sel_callID, const std::string& drag_callID); void createConfFromParticipantList(const std::vector< std::string >& participants); bool addParticipant(const std::string& callID, const std::string& confID); bool addMainParticipant(const std::string& confID); diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp index ff7e95ee8d..dae591118b 100644 --- a/daemon/src/managerimpl.cpp +++ b/daemon/src/managerimpl.cpp @@ -953,12 +953,12 @@ ManagerImpl::getCallFromCallID(const std::string &callID) return call; } -void ManagerImpl::joinParticipant(const std::string& callId1, const std::string& callId2) +bool +ManagerImpl::joinParticipant(const std::string& callId1, const std::string& callId2) { - DEBUG("Join participants %s, %s", callId1.c_str(), callId2.c_str()); if (callId1 == callId2) { ERROR("Cannot join participant %s to itself", callId1.c_str()); - return; + return false; } // Set corresponding conference ids for call 1 @@ -966,7 +966,7 @@ void ManagerImpl::joinParticipant(const std::string& callId1, const std::string& if (call1 == NULL) { ERROR("Could not find call %s", callId1.c_str()); - return; + return false; } // Set corresponding conderence details @@ -974,7 +974,7 @@ void ManagerImpl::joinParticipant(const std::string& callId1, const std::string& if (call2 == NULL) { ERROR("Could not find call %s", callId2.c_str()); - return; + return false; } std::map<std::string, std::string> call1Details(getCallDetails(callId1)); @@ -1049,6 +1049,7 @@ void ManagerImpl::joinParticipant(const std::string& callId1, const std::string& } getMainBuffer().dumpInfo(); + return true; } void ManagerImpl::createConfFromParticipantList(const std::vector< std::string > &participantList) diff --git a/daemon/src/managerimpl.h b/daemon/src/managerimpl.h index 83cf10c195..0c9c8f9b93 100644 --- a/daemon/src/managerimpl.h +++ b/daemon/src/managerimpl.h @@ -295,7 +295,8 @@ class ManagerImpl { * @param the fist call id * @param the second call id */ - void joinParticipant(const std::string& call_id1, const std::string& call_id2); + bool joinParticipant(const std::string& call_id1, + const std::string& call_id2); /** * Create a conference from a list of participant diff --git a/gnome/src/dbus/callmanager-introspec.xml b/gnome/src/dbus/callmanager-introspec.xml index ea9e3c76da..946fce25e5 100644 --- a/gnome/src/dbus/callmanager-introspec.xml +++ b/gnome/src/dbus/callmanager-introspec.xml @@ -242,6 +242,7 @@ </tp:docstring> <arg type="s" name="sel_callID" direction="in"/> <arg type="s" name="drag_callID" direction="in"/> + <arg type="b" name="joinSucceeded" direction="out"/> </method> <method name="createConfFromParticipantList" tp:name-for-bindings="createConfFromParticipantList"> diff --git a/gnome/src/dbus/dbus.c b/gnome/src/dbus/dbus.c index 7b69b57234..7c02f495e0 100644 --- a/gnome/src/dbus/dbus.c +++ b/gnome/src/dbus/dbus.c @@ -1480,7 +1480,9 @@ dbus_join_participant(const gchar *sel_callID, const gchar *drag_callID) { g_debug("Join participant %s and %s\n", sel_callID, drag_callID); GError *error = NULL; - org_sflphone_SFLphone_CallManager_join_participant(call_proxy, sel_callID, drag_callID, &error); + gboolean result; + org_sflphone_SFLphone_CallManager_join_participant(call_proxy, sel_callID, + drag_callID, &result, &error); check_error(error); } -- GitLab