[telepathy-mission-control/master] Handler: pass an empty a{sv} for future expansion

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


Also, in the regression test, assert that the user action time is
propagated.
---
 src/mcd-dispatcher.c                   |    6 +++++-
 test/twisted/dispatcher/create-text.py |    3 +++
 xml/Client_Handler.xml                 |   10 ++++++++++
 3 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 78edef4..09f3e44 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -1130,6 +1130,7 @@ mcd_dispatcher_run_handler (McdDispatcherContext *context,
         const gchar *account_path, *connection_path;
         GPtrArray *channels_array, *satisfied_requests;
         McdHandlerCallData *handler_data;
+        GHashTable *handler_info;
 
         connection = mcd_dispatcher_context_get_connection (context);
         connection_path = connection ?
@@ -1166,6 +1167,8 @@ mcd_dispatcher_run_handler (McdDispatcherContext *context,
                                      MCD_CHANNEL_STATUS_HANDLER_INVOKED);
         }
 
+        handler_info = g_hash_table_new (g_str_hash, g_str_equal);
+
         /* The callback needs to get the dispatcher context, and the channels
          * the handler was asked to handle. The context will keep track of how
          * many channels are still to be dispatched,
@@ -1178,12 +1181,13 @@ mcd_dispatcher_run_handler (McdDispatcherContext *context,
         mc_cli_client_handler_call_handle_channels (handler->proxy, -1,
             account_path, connection_path,
             channels_array, satisfied_requests, user_action_time,
-            handle_channels_cb,
+            handler_info, handle_channels_cb,
             handler_data, (GDestroyNotify)mcd_handler_call_data_free,
             (GObject *)context->dispatcher);
 
         g_ptr_array_free (satisfied_requests, TRUE);
         _mcd_channel_details_free (channels_array);
+        g_hash_table_unref (handler_info);
     }
     else
     {
diff --git a/test/twisted/dispatcher/create-text.py b/test/twisted/dispatcher/create-text.py
index 825c6d6..2ea3df8 100644
--- a/test/twisted/dispatcher/create-text.py
+++ b/test/twisted/dispatcher/create-text.py
@@ -169,6 +169,9 @@ def test_channel_creation(q, bus, account, client, conn, ensure):
     assert channels[0][0] == channel.object_path, channels
     assert channels[0][1] == channel_immutable, channels
     assert e.args[3] == [request_path], e.args
+    assert e.args[4] == user_action_time
+    assert isinstance(e.args[5], dict)
+    assert len(e.args) == 6
 
     # Handler accepts the Channels
     q.dbus_return(e.message, signature='')
diff --git a/xml/Client_Handler.xml b/xml/Client_Handler.xml
index 01dcaa4..ea38589 100644
--- a/xml/Client_Handler.xml
+++ b/xml/Client_Handler.xml
@@ -203,6 +203,16 @@
         </tp:docstring>
       </arg>
 
+      <arg name="Handler_Info" type="a{sv}" direction="in">
+        <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+          <p>Additional information about these channels. No keys are
+            currently defined.</p>
+
+          <p>If keys are defined for this dictionary, all will be optional;
+            handlers MAY safely ignore any entry in this dictionary.</p>
+        </tp:docstring>
+      </arg>
+
       <!-- FIXME: invent a way to say "any error is possible" in spec markup -->
     </method>
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list