]> git.0d.be Git - empathy.git/commitdiff
dispatcher: add timestamp attribute to DispatcherRequestData
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Sat, 24 Apr 2010 15:58:49 +0000 (16:58 +0100)
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>
Sat, 24 Apr 2010 18:44:05 +0000 (19:44 +0100)
libempathy/empathy-dispatcher.c
libempathy/empathy-dispatcher.h

index 027a9601f5a8719acdace24e70ea252e745cd944..046f6a981069d56d765ac2a65eb0d63f9a81e2b2 100644 (file)
@@ -141,6 +141,7 @@ typedef struct
 
   /* Properties to pass to the channel when requesting it */
   GHashTable *request;
+  gint64 timestamp;
   EmpathyDispatcherRequestCb *cb;
   gpointer user_data;
   gpointer *request_data;
@@ -218,6 +219,7 @@ new_dispatcher_request_data (EmpathyDispatcher *self,
                              guint handle_type,
                              guint handle,
                              GHashTable *request,
+                             gint64 timestamp,
                              EmpathyContact *contact,
                              EmpathyDispatcherRequestCb *cb,
                              gpointer user_data)
@@ -233,6 +235,7 @@ new_dispatcher_request_data (EmpathyDispatcher *self,
   result->handle_type = handle_type;
   result->handle = handle;
   result->request = request;
+  result->timestamp = timestamp;
 
   if (contact != NULL)
     result->contact = g_object_ref (contact);
@@ -1329,7 +1332,9 @@ empathy_dispatcher_chat_with_contact (EmpathyContact *contact,
   /* The contact handle might not be known yet */
   request_data = new_dispatcher_request_data (self, connection,
     TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_CONTACT,
-    empathy_contact_get_handle (contact), NULL, contact, callback, user_data);
+    empathy_contact_get_handle (contact), NULL,
+    EMPATHY_DISPATCHER_NON_USER_ACTION, contact,
+    callback, user_data);
   request_data->should_ensure = TRUE;
 
   connection_data->outstanding_requests = g_list_prepend
@@ -1459,6 +1464,7 @@ empathy_dispatcher_join_muc (TpConnection *connection,
   /* Don't know the room handle yet */
   request_data  = new_dispatcher_request_data (self, connection,
     TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_ROOM, 0, NULL,
+    EMPATHY_DISPATCHER_NON_USER_ACTION,
     NULL, callback, user_data);
   request_data->should_ensure = TRUE;
 
@@ -1619,7 +1625,7 @@ empathy_dispatcher_call_create_or_ensure_channel (
       call = tp_cli_channel_dispatcher_call_ensure_channel (
           priv->channel_dispatcher,
           -1, tp_proxy_get_object_path (TP_PROXY (account)),
-          request_data->request, 0, handler,
+          request_data->request, request_data->timestamp, handler,
           dispatcher_create_channel_cb, request_data, NULL, NULL);
     }
   else
@@ -1627,7 +1633,7 @@ empathy_dispatcher_call_create_or_ensure_channel (
       call = tp_cli_channel_dispatcher_call_create_channel (
           priv->channel_dispatcher,
           -1, tp_proxy_get_object_path (TP_PROXY (account)),
-          request_data->request, 0, handler,
+          request_data->request, request_data->timestamp, handler,
           dispatcher_create_channel_cb, request_data, NULL,
           G_OBJECT (dispatcher));
     }
@@ -1682,7 +1688,7 @@ empathy_dispatcher_create_channel (EmpathyDispatcher *self,
 
   request_data  = new_dispatcher_request_data (self, connection,
     channel_type, handle_type, handle, request,
-    NULL, callback, user_data);
+    EMPATHY_DISPATCHER_NON_USER_ACTION, NULL, callback, user_data);
 
   connection_data->outstanding_requests = g_list_prepend
     (connection_data->outstanding_requests, request_data);
index 6176ea088c854643facebbc40bcf848fa265b326..97ac49bea6f55c94c6102669ac1f2079b3ae03b5 100644 (file)
@@ -40,6 +40,8 @@ G_BEGIN_DECLS
 #define EMPATHY_IS_DISPATCHER_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_DISPATCHER))
 #define EMPATHY_DISPATCHER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_DISPATCHER, EmpathyDispatcherClass))
 
+#define EMPATHY_DISPATCHER_NON_USER_ACTION  (G_GINT64_CONSTANT (0))
+
 typedef struct _EmpathyDispatcher      EmpathyDispatcher;
 typedef struct _EmpathyDispatcherClass EmpathyDispatcherClass;