Skip to content
Snippets Groups Projects
Commit a3a79016 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3963] Deactivate participant instant messaging window when creating a conference

parent 7fd0473a
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <linux/if.h> #include <linux/if.h>
#include <widget/imwidget.h>
GHashTable * ip2ip_profile=NULL; GHashTable * ip2ip_profile=NULL;
...@@ -973,6 +973,10 @@ sflphone_detach_participant (const gchar* callID) ...@@ -973,6 +973,10 @@ sflphone_detach_participant (const gchar* callID)
selectedCall->_confID = NULL; 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_remove_call (current_calls, selectedCall, NULL);
calltree_add_call (current_calls, selectedCall, NULL); calltree_add_call (current_calls, selectedCall, NULL);
dbus_detach_participant (selectedCall->_callID); dbus_detach_participant (selectedCall->_callID);
...@@ -985,6 +989,10 @@ sflphone_detach_participant (const gchar* callID) ...@@ -985,6 +989,10 @@ sflphone_detach_participant (const gchar* callID)
selectedCall->_confID = NULL; 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_remove_call (current_calls, selectedCall, NULL);
calltree_add_call (current_calls, selectedCall, NULL); calltree_add_call (current_calls, selectedCall, NULL);
dbus_detach_participant (callID); dbus_detach_participant (callID);
......
...@@ -234,9 +234,13 @@ conference_changed_cb (DBusGProxy *proxy UNUSED, const gchar* confID, ...@@ -234,9 +234,13 @@ conference_changed_cb (DBusGProxy *proxy UNUSED, const gchar* confID,
const gchar* state, void * foo UNUSED) const gchar* state, void * foo UNUSED)
{ {
gchar** part;
callable_obj_t *call;
gchar* call_id;
// sflphone_display_transfer_status("Transfer successfull"); // sflphone_display_transfer_status("Transfer successfull");
conference_obj_t* changed_conf = conferencelist_get (confID); conference_obj_t* changed_conf = conferencelist_get (confID);
gchar** participants; gchar** old_participants, new_participants;
DEBUG ("conference new state %s\n", state); DEBUG ("conference new state %s\n", state);
...@@ -255,10 +259,32 @@ conference_changed_cb (DBusGProxy *proxy UNUSED, const gchar* confID, ...@@ -255,10 +259,32 @@ conference_changed_cb (DBusGProxy *proxy UNUSED, const gchar* confID,
DEBUG ("Error: conference state not recognized"); 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 // 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 // add new conference to calltree
calltree_add_conference (current_calls, changed_conf); calltree_add_conference (current_calls, changed_conf);
...@@ -287,6 +313,11 @@ conference_created_cb (DBusGProxy *proxy UNUSED, const gchar* confID, void * foo ...@@ -287,6 +313,11 @@ conference_created_cb (DBusGProxy *proxy UNUSED, const gchar* confID, void * foo
for (part = participants; *part; part++) { for (part = participants; *part; part++) {
call_id = (gchar*) (*part); call_id = (gchar*) (*part);
call = calllist_get (current_calls, call_id); 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); call->_confID = g_strdup (confID);
} }
...@@ -305,6 +336,11 @@ conference_removed_cb (DBusGProxy *proxy UNUSED, const gchar* confID, void * foo ...@@ -305,6 +336,11 @@ conference_removed_cb (DBusGProxy *proxy UNUSED, const gchar* confID, void * foo
GSList *participant = c->participant_list; GSList *participant = c->participant_list;
callable_obj_t *call; 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) { while (participant) {
call = calllist_get (current_calls, (const gchar *) (participant->data)); call = calllist_get (current_calls, (const gchar *) (participant->data));
...@@ -316,6 +352,10 @@ conference_removed_cb (DBusGProxy *proxy UNUSED, const gchar* confID, void * foo ...@@ -316,6 +352,10 @@ conference_removed_cb (DBusGProxy *proxy UNUSED, const gchar* confID, void * foo
g_free (call->_confID); g_free (call->_confID);
call->_confID = NULL; 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); participant = conference_next_participant (participant);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment