[telepathy-mission-control/master] fd.o #21256: ChannelRequest: add stub Interfaces property and assert that it's there

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Apr 17 11:10:04 PDT 2009


---
 .../libmissioncontrol-server/tmpl/mcd-channel.sgml |    5 +++++
 src/mcd-channel.c                                  |   15 +++++++++++++++
 src/mcd-dispatcher.c                               |    6 ++++++
 test/twisted/dispatcher/create-text.py             |    2 ++
 xml/Channel_Request.xml                            |    8 ++++++++
 5 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/doc/reference/libmissioncontrol-server/tmpl/mcd-channel.sgml b/doc/reference/libmissioncontrol-server/tmpl/mcd-channel.sgml
index 968dc4c..6808aa3 100644
--- a/doc/reference/libmissioncontrol-server/tmpl/mcd-channel.sgml
+++ b/doc/reference/libmissioncontrol-server/tmpl/mcd-channel.sgml
@@ -43,6 +43,11 @@ McdChannel
 
 </para>
 
+<!-- ##### ARG McdChannel:interfaces ##### -->
+<para>
+
+</para>
+
 <!-- ##### ARG McdChannel:outgoing ##### -->
 <para>
 
diff --git a/src/mcd-channel.c b/src/mcd-channel.c
index d284371..6875d62 100644
--- a/src/mcd-channel.c
+++ b/src/mcd-channel.c
@@ -112,6 +112,7 @@ enum _McdChannelPropertyType
     PROP_REQUESTS,
     PROP_USER_ACTION_TIME,
     PROP_PREFERRED_HANDLER,
+    PROP_INTERFACES,
 };
 
 #define DEPRECATED_PROPERTY_WARNING \
@@ -428,6 +429,11 @@ _mcd_channel_get_property (GObject * obj, guint prop_id,
         g_value_take_boxed (val, g_ptr_array_sized_new (0));
         break;
 
+    case PROP_INTERFACES:
+        /* we have no interfaces */
+        g_value_set_static_boxed (val, NULL);
+        break;
+
     default:
 	G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
 	break;
@@ -562,6 +568,7 @@ mcd_channel_class_init (McdChannelClass * klass)
         { "Account", "account-path", NULL },
         { "UserActionTime", "user-action-time", NULL },
         { "PreferredHandler", "preferred-handler", NULL },
+        { "Interfaces", "interfaces", NULL },
         { "Requests", "requests", NULL },
         { NULL }
     };
@@ -651,6 +658,14 @@ mcd_channel_class_init (McdChannelClass * klass)
                              TP_ARRAY_TYPE_QUALIFIED_PROPERTY_VALUE_MAP_LIST,
                              G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
 
+    g_object_class_install_property
+        (object_class, PROP_INTERFACES,
+         g_param_spec_boxed ("interfaces",
+                             "Interfaces",
+                             "A dbus-glib 'as'",
+                             G_TYPE_STRV,
+                             G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
     klass->dbus_properties_class.interfaces = prop_interfaces,
     tp_dbus_properties_mixin_class_init (object_class,
         G_STRUCT_OFFSET (McdChannelClass, dbus_properties_class));
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 55cd3cf..6a05cb1 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -3029,6 +3029,7 @@ _mcd_dispatcher_add_request (McdDispatcher *dispatcher, McdAccount *account,
     GValue v_requests = { 0, };
     GValue v_account = { 0, };
     GValue v_preferred_handler = { 0, };
+    GValue v_interfaces = { 0, };
     GPtrArray *requests;
     McdRemoveRequestData *rrd;
 
@@ -3071,6 +3072,11 @@ _mcd_dispatcher_add_request (McdDispatcher *dispatcher, McdAccount *account,
     g_hash_table_insert (properties, "org.freedesktop.Telepathy.ChannelRequest"
                          ".Account", &v_account);
 
+    g_value_init (&v_interfaces, G_TYPE_STRV);
+    g_value_set_static_boxed (&v_interfaces, NULL);
+    g_hash_table_insert (properties, "org.freedesktop.Telepathy.ChannelRequest"
+                         ".Interfaces", &v_interfaces);
+
     g_value_init (&v_preferred_handler, G_TYPE_STRING);
     g_value_set_static_string (&v_preferred_handler,
         _mcd_channel_get_request_preferred_handler (channel));
diff --git a/test/twisted/dispatcher/create-text.py b/test/twisted/dispatcher/create-text.py
index ccbdfba..2781027 100644
--- a/test/twisted/dispatcher/create-text.py
+++ b/test/twisted/dispatcher/create-text.py
@@ -89,6 +89,7 @@ def test_channel_creation(q, bus, account, client, conn, ensure):
     assert request_props['Requests'] == [request]
     assert request_props['UserActionTime'] == user_action_time
     assert request_props['PreferredHandler'] == client.bus_name
+    assert request_props['Interfaces'] == []
 
     cr.Proceed(dbus_interface=cs.CR + '.DRAFT')
 
@@ -114,6 +115,7 @@ def test_channel_creation(q, bus, account, client, conn, ensure):
     # FIXME: this is not actually in telepathy-spec (although maybe it
     # should be) - fd.o #21013
     assert request_props[cs.CR + '.PreferredHandler'] == client.bus_name
+    assert request_props[cs.CR + '.Interfaces'] == []
 
     q.dbus_return(add_request_call.message, signature='')
 
diff --git a/xml/Channel_Request.xml b/xml/Channel_Request.xml
index e1ba48e..32eca34 100644
--- a/xml/Channel_Request.xml
+++ b/xml/Channel_Request.xml
@@ -99,6 +99,14 @@
       </tp:docstring>
     </property>
 
+    <property name="Interfaces" tp:name-for-bindings="Interfaces"
+      type="as" access="read" tp:type="DBus_Interface[]">
+      <tp:docstring>
+        A list of the extra interfaces provided by this channel request.
+        This property cannot change.
+      </tp:docstring>
+    </property>
+
     <method name="Proceed" tp:name-for-bindings="Proceed">
       <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
         <p>Proceed with the channel request.</p>
-- 
1.5.6.5




More information about the telepathy-commits mailing list