diff --git a/sflphone-client-gnome/src/actions.c b/sflphone-client-gnome/src/actions.c index 6172b7e0a806919f8f2eeb3c0f099cea450e4cb1..f729d667cb63f174a3aeb9771a113cdeca45165b 100644 --- a/sflphone-client-gnome/src/actions.c +++ b/sflphone-client-gnome/src/actions.c @@ -51,7 +51,7 @@ #include <sys/ioctl.h> #include <linux/if.h> - +#include <widget/imwidget.h> GHashTable * ip2ip_profile=NULL; @@ -973,6 +973,10 @@ sflphone_detach_participant (const gchar* callID) selectedCall->_confID = NULL; } + // Instant messaging widget should have been deactivated during the conference + if (selectedCall->_im_widget) + im_widget_update_state (IM_WIDGET (selectedCall->_im_widget), TRUE); + calltree_remove_call (current_calls, selectedCall, NULL); calltree_add_call (current_calls, selectedCall, NULL); dbus_detach_participant (selectedCall->_callID); @@ -985,6 +989,10 @@ sflphone_detach_participant (const gchar* callID) selectedCall->_confID = NULL; } + // Instant messagin widget should have been deactivated during the conference + if (selectedCall->_im_widget) + im_widget_update_state (IM_WIDGET (selectedCall->_im_widget), TRUE); + calltree_remove_call (current_calls, selectedCall, NULL); calltree_add_call (current_calls, selectedCall, NULL); dbus_detach_participant (callID); diff --git a/sflphone-client-gnome/src/dbus/dbus.c b/sflphone-client-gnome/src/dbus/dbus.c index e7616b3780bb777e7a0803b1cea8d76b24b028d9..49aed581ef48199d94b70494e600485ee0fd9f6d 100644 --- a/sflphone-client-gnome/src/dbus/dbus.c +++ b/sflphone-client-gnome/src/dbus/dbus.c @@ -234,9 +234,13 @@ conference_changed_cb (DBusGProxy *proxy UNUSED, const gchar* confID, const gchar* state, void * foo UNUSED) { + gchar** part; + callable_obj_t *call; + gchar* call_id; + // sflphone_display_transfer_status("Transfer successfull"); conference_obj_t* changed_conf = conferencelist_get (confID); - gchar** participants; + gchar** old_participants, new_participants; DEBUG ("conference new state %s\n", state); @@ -255,10 +259,32 @@ conference_changed_cb (DBusGProxy *proxy UNUSED, const gchar* confID, DEBUG ("Error: conference state not recognized"); } - participants = (gchar**) dbus_get_participant_list (changed_conf->_confID); + // reactivate instant messaging window for these calls + old_participants = (gchar**) changed_conf->participant_list; + + for (part = old_participants; *part; part++) { + call_id = (gchar*) (*part); + call = calllist_get (current_calls, call_id); + + if (call && call->_im_widget) + im_widget_update_state (call->_im_widget, TRUE); + } + + new_participants = (gchar**) dbus_get_participant_list (changed_conf->_confID); // update conferece participants - conference_participant_list_update (participants, changed_conf); + conference_participant_list_update (new_participants, changed_conf); + + // deactivate instant messaging window for new participants + new_participants = (gchar**) changed_conf->participant_list; + + for (part = new_participants; *part; part++) { + call_id = (gchar*) (*part); + call = calllist_get (current_calls, call_id); + + if (call && call->_im_widget) + im_widget_update_state (call->_im_widget, FALSE); + } // add new conference to calltree calltree_add_conference (current_calls, changed_conf); @@ -287,6 +313,11 @@ conference_created_cb (DBusGProxy *proxy UNUSED, const gchar* confID, void * foo for (part = participants; *part; part++) { call_id = (gchar*) (*part); call = calllist_get (current_calls, call_id); + + // if a text widget is already created, disable it, use conference widget instead + if (call->_im_widget) + im_widget_update_state (IM_WIDGET (call->_im_widget), FALSE); + call->_confID = g_strdup (confID); } @@ -305,6 +336,11 @@ conference_removed_cb (DBusGProxy *proxy UNUSED, const gchar* confID, void * foo GSList *participant = c->participant_list; callable_obj_t *call; + // deactivate instant messaging window for this conference + if (c->_im_widget) + im_widget_update_state (c->_im_widget, FALSE); + + // remove all participant for this conference while (participant) { call = calllist_get (current_calls, (const gchar *) (participant->data)); @@ -316,6 +352,10 @@ conference_removed_cb (DBusGProxy *proxy UNUSED, const gchar* confID, void * foo g_free (call->_confID); call->_confID = NULL; } + + // if an instant messaging was previously disabled, enabled it + if (call->_im_widget) + im_widget_update_state (call->_im_widget, TRUE); } participant = conference_next_participant (participant);