[telepathy-mission-control/master] _mcd_client_proxy_handle_channels: automatically extract user_action_time from any channels that are really requests

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Nov 2 07:18:13 PST 2009


---
 src/mcd-client-priv.h        |    2 +-
 src/mcd-client.c             |   13 ++++++++++++-
 src/mcd-dispatch-operation.c |    7 +------
 src/mcd-dispatcher.c         |    8 ++++----
 4 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/src/mcd-client-priv.h b/src/mcd-client-priv.h
index e78dfbf..6f0702d 100644
--- a/src/mcd-client-priv.h
+++ b/src/mcd-client-priv.h
@@ -116,7 +116,7 @@ G_GNUC_INTERNAL guint _mcd_client_match_filters (
 G_GNUC_INTERNAL void _mcd_client_proxy_handle_channels (McdClientProxy *self,
     gint timeout_ms, const gchar *account_path,
     const GList *channels, const GPtrArray *requests_satisfied,
-    guint64 user_action_time, GHashTable *handler_info,
+    gint64 user_action_time, GHashTable *handler_info,
     tp_cli_client_handler_callback_for_handle_channels callback,
     gpointer user_data, GDestroyNotify destroy, GObject *weak_object);
 
diff --git a/src/mcd-client.c b/src/mcd-client.c
index 6e7bb78..ca12e3d 100644
--- a/src/mcd-client.c
+++ b/src/mcd-client.c
@@ -1560,7 +1560,7 @@ _mcd_client_proxy_handle_channels (McdClientProxy *self,
     const gchar *account_path,
     const GList *channels,
     const GPtrArray *requests_satisfied,
-    guint64 user_action_time,
+    gint64 user_action_time,
     GHashTable *handler_info,
     tp_cli_client_handler_callback_for_handle_channels callback,
     gpointer user_data,
@@ -1568,12 +1568,23 @@ _mcd_client_proxy_handle_channels (McdClientProxy *self,
     GObject *weak_object)
 {
     GPtrArray *channel_details;
+    const GList *iter;
 
     g_return_if_fail (MCD_IS_CLIENT_PROXY (self));
     g_return_if_fail (channels != NULL);
 
     channel_details = _mcd_channel_details_build_from_list (channels);
 
+    for (iter = channels; iter != NULL; iter = iter->next)
+    {
+        gint64 req_time = 0;
+
+        _mcd_channel_get_satisfied_requests (iter->data, &req_time);
+
+        if (req_time > user_action_time)
+            user_action_time = req_time;
+    }
+
     tp_cli_client_handler_call_handle_channels ((TpClient *) self,
         timeout_ms, account_path,
         borrow_channel_connection_path (channels->data), channel_details,
diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index 43599a9..dba29af 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -1678,19 +1678,14 @@ mcd_dispatch_operation_handle_channels (McdDispatchOperation *self,
     {
         McdChannel *channel = MCD_CHANNEL (cl->data);
         const GList *requests;
-        gint64 req_time;
 
-        requests = _mcd_channel_get_satisfied_requests (channel,
-                                                        &req_time);
+        requests = _mcd_channel_get_satisfied_requests (channel, NULL);
         while (requests)
         {
             g_ptr_array_add (satisfied_requests, requests->data);
             requests = requests->next;
         }
 
-        if (req_time > user_action_time)
-            user_action_time = req_time;
-
         _mcd_channel_set_status (channel,
                                  MCD_CHANNEL_STATUS_HANDLER_INVOKED);
     }
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index b68a949..92768c0 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -1764,7 +1764,6 @@ _mcd_dispatcher_reinvoke_handler (McdDispatcher *dispatcher,
     McdAccount *account;
     const gchar *account_path;
     const GList *requests;
-    gint64 user_action_time;
     McdClientProxy *handler;
 
     request_as_list = g_list_append (NULL, request);
@@ -1820,8 +1819,7 @@ _mcd_dispatcher_reinvoke_handler (McdDispatcher *dispatcher,
 
     satisfied_requests = g_ptr_array_new ();
 
-    for (requests = _mcd_channel_get_satisfied_requests (request,
-                                                         &user_action_time);
+    for (requests = _mcd_channel_get_satisfied_requests (request, NULL);
          requests != NULL;
          requests = requests->next)
     {
@@ -1834,7 +1832,9 @@ _mcd_dispatcher_reinvoke_handler (McdDispatcher *dispatcher,
 
     _mcd_client_proxy_handle_channels (handler,
         -1, account_path, request_as_list,
-        satisfied_requests, user_action_time, handler_info,
+        satisfied_requests,
+        0, /* the request's user action time will be used automatically */
+        handler_info,
         reinvoke_handle_channels_cb, NULL, NULL, (GObject *) request);
 
     g_ptr_array_free (satisfied_requests, TRUE);
-- 
1.5.6.5




More information about the telepathy-commits mailing list