[Telepathy-commits] [telepathy-gabble/master] olpc-view: return the right channel-type with GetChannelType

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Oct 10 03:32:49 PDT 2008


---
 src/olpc-view.c                            |    7 +++++--
 tests/twisted/olpc/olpc-activity-search.py |    3 +++
 tests/twisted/olpc/olpc-buddy-search.py    |    3 +++
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/olpc-view.c b/src/olpc-view.c
index 78efc0d..b720d4c 100644
--- a/src/olpc-view.c
+++ b/src/olpc-view.c
@@ -613,8 +613,11 @@ static void
 gabble_olpc_view_get_channel_type (TpSvcChannel *iface,
                                    DBusGMethodInvocation *context)
 {
-  tp_svc_channel_return_from_get_channel_type (context,
-      GABBLE_IFACE_OLPC_CHANNEL_TYPE_BUDDY_VIEW);
+  gchar *channel_type;
+
+  g_object_get (iface, "channel-type", &channel_type, NULL);
+  tp_svc_channel_return_from_get_channel_type (context, channel_type);
+  g_free (channel_type);
 }
 
 /**
diff --git a/tests/twisted/olpc/olpc-activity-search.py b/tests/twisted/olpc/olpc-activity-search.py
index 2373c02..7116dbe 100644
--- a/tests/twisted/olpc/olpc-activity-search.py
+++ b/tests/twisted/olpc/olpc-activity-search.py
@@ -125,6 +125,9 @@ def test(q, bus, conn, stream):
     assert props['Properties'] == {}
     assert props['Participants'] == []
 
+    assert view1.GetChannelType(dbus_interface='org.freedesktop.Telepathy.Channel') ==\
+            'org.laptop.Telepathy.Channel.Type.ActivityView'
+
     ## Current views ##
     # view 1: activity 1 (with: Lucien, Jean)
 
diff --git a/tests/twisted/olpc/olpc-buddy-search.py b/tests/twisted/olpc/olpc-buddy-search.py
index ca48193..49cc431 100644
--- a/tests/twisted/olpc/olpc-buddy-search.py
+++ b/tests/twisted/olpc/olpc-buddy-search.py
@@ -183,6 +183,9 @@ def test(q, bus, conn, stream):
     assert props['Properties'] == {}
     assert props['Alias'] == ''
 
+    assert view1.GetChannelType(dbus_interface='org.freedesktop.Telepathy.Channel') ==\
+            'org.laptop.Telepathy.Channel.Type.BuddyView'
+
     event = q.expect('dbus-signal', signal='BuddiesChanged')
     added, removed = event.args
     assert removed == []
-- 
1.5.6.5




More information about the Telepathy-commits mailing list