telepathy-glib: simple-channel-request: allow to create room list channels
Guillaume Desmottes
gdesmott at kemper.freedesktop.org
Mon Apr 30 02:47:38 PDT 2012
Module: telepathy-glib
Branch: master
Commit: fa95a0e28015a847870368b5855c44ddd330fb68
URL: http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=fa95a0e28015a847870368b5855c44ddd330fb68
Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date: Tue Apr 17 15:36:48 2012 +0200
simple-channel-request: allow to create room list channels
---
tests/lib/simple-channel-request.c | 24 ++++++++++++++++++++----
1 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/tests/lib/simple-channel-request.c b/tests/lib/simple-channel-request.c
index fbf134f..8bf418c 100644
--- a/tests/lib/simple-channel-request.c
+++ b/tests/lib/simple-channel-request.c
@@ -93,13 +93,29 @@ add_channel (TpTestsSimpleChannelRequest *self,
gchar *chan_path;
GHashTable *request;
GHashTable *props;
+ const char *chan_type;
request = g_ptr_array_index (self->priv->requests, 0);
- target_id = tp_asv_get_string (request, TP_PROP_CHANNEL_TARGET_ID);
- g_assert (target_id != NULL);
+ chan_type = tp_asv_get_string (request, TP_PROP_CHANNEL_CHANNEL_TYPE);
- chan_path = tp_tests_simple_connection_ensure_text_chan (self->priv->conn,
- target_id, &props);
+ if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_TEXT))
+ {
+ target_id = tp_asv_get_string (request, TP_PROP_CHANNEL_TARGET_ID);
+ g_assert (target_id != NULL);
+
+ chan_path = tp_tests_simple_connection_ensure_text_chan (self->priv->conn,
+ target_id, &props);
+ }
+ else if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_ROOM_LIST))
+ {
+ chan_path = tp_tests_simple_connection_ensure_room_list_chan (
+ self->priv->conn, tp_asv_get_string (request,
+ TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER), &props);
+ }
+ else
+ {
+ g_assert_not_reached ();
+ }
g_ptr_array_add (channels, tp_value_array_build (2,
DBUS_TYPE_G_OBJECT_PATH, chan_path,
More information about the telepathy-commits
mailing list