diff --git a/gnome/src/dbus/dbus.c b/gnome/src/dbus/dbus.c index b2cce241cc23f13cf8e078a9885a2c98b7a818d7..437255bce501e99196b7709ea3f69a9563a664fd 100644 --- a/gnome/src/dbus/dbus.c +++ b/gnome/src/dbus/dbus.c @@ -2059,6 +2059,18 @@ dbus_get_conference_list(void) return list; } +gchar ** +dbus_get_display_name_list(const gchar *confID) +{ + GError *error = NULL; + gchar **list = NULL; + + org_sflphone_SFLphone_CallManager_get_display_names(call_proxy, confID, &list, &error); + check_error(error); + + return list; +} + gchar ** dbus_get_participant_list(const gchar *confID) { diff --git a/gnome/src/dbus/dbus.h b/gnome/src/dbus/dbus.h index 230237f8de47666b572b616c81a81a6db1dc9380..619ade0766db172e342effb53cbd5a4d5feafb1f 100644 --- a/gnome/src/dbus/dbus.h +++ b/gnome/src/dbus/dbus.h @@ -428,6 +428,12 @@ gint dbus_get_sip_address(void); */ void dbus_add_participant(const gchar *callID, const gchar *confID); +/** + * Return a list of display names for this conference (confID) + */ +gchar ** +dbus_get_display_name_list(const gchar *confID); + /** * Return a list of participant for this conference (confID) */ diff --git a/gnome/src/video/video_callbacks.c b/gnome/src/video/video_callbacks.c index bf532eaa451e53050469cccbda132756d73875ec..920d2d6366f49a3bc631c33e473b047adf60cf19 100644 --- a/gnome/src/video/video_callbacks.c +++ b/gnome/src/video/video_callbacks.c @@ -258,57 +258,27 @@ add_handle(const gchar *id) title_prefix = _("Conference with"); /* get all the participants name */ - gchar **participant_list = dbus_get_participant_list(id); - for (gchar **participant = participant_list; participant && *participant; participant++) { - g_debug("participant %s\n", *participant); - - gchar *new_name = NULL; - - /* create a new callable object to manipulate the id details */ - callable_obj_t *c = create_new_call_from_details(*participant, dbus_get_call_details(*participant)); - - /* if no display name, we show the peer_number */ - if (g_strcmp0(c->_display_name, "") != 0) { - new_name = g_strdup(c->_display_name); - } else { - new_name = g_strdup(c->_peer_number); - } - - /* if name exists we must add the new name to the list */ - if (name) { - gchar *name_list = g_strdup_printf("%s, %s", name, new_name); - g_free(name); - name = name_list; - } else { - name = g_strdup(new_name); - } - - g_free(new_name); - g_free(c); - } - - g_strfreev(participant_list); + gchar **display_name_list = dbus_get_display_name_list(id); + name = g_strjoinv(", ", display_name_list); + g_strfreev(display_name_list); } else if (call_type == IS_CALL) { /* on a simple call */ - /* create a new callable object to manipulate the call details */ - callable_obj_t *c = create_new_call_from_details(id, dbus_get_call_details(id)); + GHashTable *details = dbus_get_call_details(id); /* build the prefix title name */ title_prefix = _("Call with"); /* if no display name, we show the peer_number */ - if (g_strcmp0(c->_display_name, "") != 0) { - name = g_strdup(c->_display_name); - } else { - name = g_strdup(c->_peer_number); - } - - g_free(c); + const gchar *display_name = g_hash_table_lookup(details, "DISPLAY_NAME"); + if (strlen(display_name) != 0) + name = g_strdup(display_name); + else + name = g_strdup(g_hash_table_lookup(details, "PEER_NUMBER")); } /* build the final title name */ - window_title = g_strdup_printf("%s %s", title_prefix, name); + window_title = g_strjoin(" ", title_prefix, name, NULL); /* update the window title */ gtk_window_set_title(GTK_WINDOW(handle->window), window_title);