summaryrefslogtreecommitdiff
path: root/src/tube-dbus.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-05-29 15:27:19 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-06-26 15:21:31 +0100
commit2a11a64bebaf319e52a261a79c43f45cc7e7ed66 (patch)
tree9118905279e7d2d71264819ae12a8566b308fa06 /src/tube-dbus.c
parent978b667252db9c824532431052727171155261c8 (diff)
downloadtelepathy-salut-2a11a64bebaf319e52a261a79c43f45cc7e7ed66.tar.gz
fire DBusTube.DBusNamesChanged signal
Diffstat (limited to 'src/tube-dbus.c')
-rw-r--r--src/tube-dbus.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/tube-dbus.c b/src/tube-dbus.c
index 58e89927..17e3b6cf 100644
--- a/src/tube-dbus.c
+++ b/src/tube-dbus.c
@@ -1556,6 +1556,8 @@ salut_tube_dbus_add_name (SalutTubeDBus *self,
SalutTubeDBusPrivate *priv = SALUT_TUBE_DBUS_GET_PRIVATE (self);
TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
(TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
+ GHashTable *added;
+ GArray *removed;
g_assert (priv->handle_type == TP_HANDLE_TYPE_ROOM);
@@ -1588,6 +1590,18 @@ salut_tube_dbus_add_name (SalutTubeDBus *self,
g_strdup (name));
tp_handle_ref (contact_repo, handle);
+ /* Fire DBusNamesChanged (new API) */
+ added = g_hash_table_new (g_direct_hash, g_direct_equal);
+ removed = g_array_new (FALSE, FALSE, sizeof (TpHandle));
+
+ g_hash_table_insert (added, GUINT_TO_POINTER (handle), (gchar *) name);
+
+ tp_svc_channel_type_dbus_tube_emit_dbus_names_changed (self, added,
+ removed);
+
+ g_hash_table_destroy (added);
+ g_array_free (removed, TRUE);
+
return TRUE;
}
@@ -1599,6 +1613,8 @@ salut_tube_dbus_remove_name (SalutTubeDBus *self,
TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
(TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
const gchar *name;
+ GHashTable *added;
+ GArray *removed;
g_assert (priv->handle_type == TP_HANDLE_TYPE_ROOM);
@@ -1608,6 +1624,17 @@ salut_tube_dbus_remove_name (SalutTubeDBus *self,
g_hash_table_remove (priv->dbus_names, GUINT_TO_POINTER (handle));
+ /* Fire DBusNamesChanged (new API) */
+ added = g_hash_table_new (g_direct_hash, g_direct_equal);
+ removed = g_array_new (FALSE, FALSE, sizeof (TpHandle));
+
+ g_array_append_val (removed, handle);
+
+ tp_svc_channel_type_dbus_tube_emit_dbus_names_changed (self, added,
+ removed);
+
+ g_hash_table_destroy (added);
+ g_array_free (removed, TRUE);
tp_handle_unref (contact_repo, handle);
return TRUE;
}