[Telepathy-commits] [telepathy-gabble/master] conn-requests: when listing channels using the old API, assume that all channels owned by managers implement TpChannelIface, and list them too
Simon McVittie
simon.mcvittie at collabora.co.uk
Mon Nov 3 11:20:37 PST 2008
20080729172501-53eee-cb30166bdf1dc84987b28fb225757e45cb4d7ecc.gz
---
src/conn-requests.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/src/conn-requests.c b/src/conn-requests.c
index 6d8bd64..0a3bb68 100644
--- a/src/conn-requests.c
+++ b/src/conn-requests.c
@@ -540,6 +540,8 @@ list_channel_factory_foreach_one (TpChannelIface *chan,
GValue *entry = tp_dbus_specialized_value_slice_new
(TP_STRUCT_TYPE_CHANNEL_INFO);
+ g_assert (TP_IS_CHANNEL_IFACE (channel));
+
g_object_get (channel,
"object-path", &path,
"channel-type", &type,
@@ -560,6 +562,17 @@ list_channel_factory_foreach_one (TpChannelIface *chan,
g_free (type);
}
+
+static void
+list_channel_manager_foreach_one (GabbleExportableChannel *channel,
+ gpointer data)
+{
+ /* FIXME: in the longer term, we don't really want to keep assuming that
+ * every GabbleExportableChannel is a TpChannelIface */
+ list_channel_factory_foreach_one (TP_CHANNEL_IFACE (channel), data);
+}
+
+
static void
conn_requests_list_channels (TpSvcConnection *iface,
DBusGMethodInvocation *context)
@@ -584,6 +597,15 @@ conn_requests_list_channels (TpSvcConnection *iface,
list_channel_factory_foreach_one, values);
}
+ for (i = 0; i < self->channel_managers->len; i++)
+ {
+ GabbleChannelManager *manager = g_ptr_array_index
+ (self->channel_managers, i);
+
+ gabble_channel_manager_foreach_channel (manager,
+ list_channel_manager_foreach_one, values);
+ }
+
channels = g_ptr_array_sized_new (values->len);
for (i = 0; i < values->len; i++)
--
1.5.6.5
More information about the Telepathy-commits
mailing list