]> git.0d.be Git - empathy.git/commitdiff
add timestamp arg to empathy_dispatcher_chat_with_contact(_id)
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Sat, 24 Apr 2010 16:16:32 +0000 (17:16 +0100)
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>
Sat, 24 Apr 2010 18:44:09 +0000 (19:44 +0100)
libempathy-gtk/empathy-chat.c
libempathy-gtk/empathy-contact-list-view.c
libempathy-gtk/empathy-contact-menu.c
libempathy-gtk/empathy-new-message-dialog.c
libempathy/empathy-dispatcher.c
libempathy/empathy-dispatcher.h
src/empathy-chat-manager.c
src/empathy-chat-window.c
tests/interactive/empetit.c

index b06329a67c1cad878296921fb1f0c28296fac2d0..06ee4bbe7658e43bc0151eb5981b1e6196b3f875 100644 (file)
@@ -262,7 +262,7 @@ reconnected_connection_ready_cb (TpConnection *connection,
        switch (priv->handle_type) {
                case TP_HANDLE_TYPE_CONTACT:
                        empathy_dispatcher_chat_with_contact_id (
-                               connection, priv->id,
+                               connection, priv->id, EMPATHY_DISPATCHER_NON_USER_ACTION,
                                chat_connect_channel_reconnected,
                                chat);
                        break;
@@ -767,6 +767,7 @@ chat_command_msg_internal (EmpathyChat *chat,
        data->message = g_strdup (message);
        connection = empathy_tp_chat_get_connection (priv->tp_chat);
        empathy_dispatcher_chat_with_contact_id (connection, contact_id,
+                                                gtk_get_current_event_time (),
                                                 chat_command_msg_cb,
                                                 data);
 }
index 15df212ce1be7e2183e21ed821146a167218330a..ae84e3e157a0eeea52e8bc76633b6376e7cc6e5f 100644 (file)
@@ -804,7 +804,8 @@ contact_list_view_row_activated (GtkTreeView       *view,
 
        if (contact) {
                DEBUG ("Starting a chat");
-               empathy_dispatcher_chat_with_contact (contact, NULL, NULL);
+               empathy_dispatcher_chat_with_contact (contact,
+                       gtk_get_current_event_time (), NULL, NULL);
                g_object_unref (contact);
        }
 }
index fbcd8dc8a3f98efbe400aa92bfc397f2e64993ed..e160f5e209183d51626e4364cddf5472e87cfe42 100644 (file)
@@ -222,7 +222,8 @@ static void
 empathy_contact_chat_menu_item_activated (GtkMenuItem *item,
        EmpathyContact *contact)
 {
-  empathy_dispatcher_chat_with_contact (contact, NULL, NULL);
+  empathy_dispatcher_chat_with_contact (contact, gtk_get_current_event_time (),
+      NULL, NULL);
 }
 
 GtkWidget *
index 338da276077a6bb224a2966e47bda0c60fdbb82f..5094385750c37e42306ee5cece8ecb0b4a98284c 100644 (file)
@@ -70,7 +70,8 @@ empathy_new_message_dialog_response (GtkDialog *dialog, int response_id)
 
   if (EMP_STR_EMPTY (contact_id) || connection == NULL) goto out;
 
-  empathy_dispatcher_chat_with_contact_id (connection, contact_id, NULL, NULL);
+  empathy_dispatcher_chat_with_contact_id (connection, contact_id,
+      gtk_get_current_event_time (), NULL, NULL);
 
 out:
   gtk_widget_destroy (GTK_WIDGET (dialog));
index 046f6a981069d56d765ac2a65eb0d63f9a81e2b2..40ee5dd88c30fbd2dc7663b61a5d6273cf39e8f5 100644 (file)
@@ -1301,6 +1301,7 @@ dispatcher_request_channel (DispatcherRequestData *request_data)
 
 void
 empathy_dispatcher_chat_with_contact (EmpathyContact *contact,
+                                      gint64 timestamp,
                                       EmpathyDispatcherRequestCb *callback,
                                       gpointer user_data)
 {
@@ -1332,8 +1333,7 @@ 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,
-    EMPATHY_DISPATCHER_NON_USER_ACTION, contact,
+    empathy_contact_get_handle (contact), NULL, timestamp, contact,
     callback, user_data);
   request_data->should_ensure = TRUE;
 
@@ -1351,6 +1351,7 @@ typedef struct
   EmpathyDispatcher *dispatcher;
   EmpathyDispatcherRequestCb *callback;
   gpointer user_data;
+  gint64 timestamp;
 } ChatWithContactIdData;
 
 static void
@@ -1373,8 +1374,8 @@ dispatcher_chat_with_contact_id_cb (EmpathyTpContactFactory *factory,
     }
   else
     {
-      empathy_dispatcher_chat_with_contact (contact, data->callback,
-          data->user_data);
+      empathy_dispatcher_chat_with_contact (contact, data->timestamp,
+          data->callback, data->user_data);
     }
 
   g_object_unref (data->dispatcher);
@@ -1384,6 +1385,7 @@ dispatcher_chat_with_contact_id_cb (EmpathyTpContactFactory *factory,
 void
 empathy_dispatcher_chat_with_contact_id (TpConnection *connection,
                                          const gchar *contact_id,
+                                         gint64 timestamp,
                                          EmpathyDispatcherRequestCb *callback,
                                          gpointer user_data)
 {
@@ -1400,6 +1402,7 @@ empathy_dispatcher_chat_with_contact_id (TpConnection *connection,
   data->dispatcher = self;
   data->callback = callback;
   data->user_data = user_data;
+  data->timestamp = timestamp;
   empathy_tp_contact_factory_get_from_id (factory, contact_id,
       dispatcher_chat_with_contact_id_cb, data, NULL, NULL);
 
index 97ac49bea6f55c94c6102669ac1f2079b3ae03b5..b3e9e1dda0df767223d6f301b4cc3465062a8c6c 100644 (file)
@@ -72,10 +72,14 @@ void empathy_dispatcher_create_channel (EmpathyDispatcher *dispatcher,
 
 /* Requesting 1 to 1 text channels */
 void empathy_dispatcher_chat_with_contact_id (TpConnection *connection,
-  const gchar *contact_id, EmpathyDispatcherRequestCb *callback,
+  const gchar *contact_id,
+  gint64 timestamp,
+  EmpathyDispatcherRequestCb *callback,
   gpointer user_data);
 void  empathy_dispatcher_chat_with_contact (EmpathyContact *contact,
-  EmpathyDispatcherRequestCb *callback, gpointer user_data);
+  gint64 timestamp,
+  EmpathyDispatcherRequestCb *callback,
+  gpointer user_data);
 
 /* Request a file channel to a specific contact */
 void empathy_dispatcher_send_file_to_contact (EmpathyContact *contact,
index 01506f52e939b71551c83ded1bb257a698eadb23..35b23244c3db9c490b5ccc84f5987d65000df993 100644 (file)
@@ -202,7 +202,7 @@ connection_ready_cb (TpConnection *connection,
         empathy_dispatcher_join_muc (connection, data->id, NULL, NULL);
       else
         empathy_dispatcher_chat_with_contact_id (connection, data->id,
-            NULL, NULL);
+            EMPATHY_DISPATCHER_NON_USER_ACTION, NULL, NULL);
 
       g_signal_emit (self, signals[CHATS_CHANGED], 0,
           g_queue_get_length (priv->queue));
index 6e80bb458cf44892443ee0f0cae28a6c8f38002e..847c7f834d54a1407ab26798d92a9b9c5832e133 100644 (file)
@@ -1682,7 +1682,7 @@ chat_window_drag_data_received (GtkWidget        *widget,
 
                        if (connection) {
                                empathy_dispatcher_chat_with_contact_id (
-                                       connection, contact_id, NULL, NULL);
+                                       connection, contact_id, gtk_get_current_event_time (), NULL, NULL);
                        }
 
                        g_strfreev (strv);
index e2eb61f66eeaec3007cec65d5994e2bef9c08df4..7bcaf03eea0fe6f65ddb292369ed26028cc34891 100644 (file)
@@ -42,7 +42,8 @@ clicked_cb (GtkButton *button,
   if (!contact)
     return;
 
-  empathy_dispatcher_chat_with_contact (contact, chat_cb, NULL);
+  empathy_dispatcher_chat_with_contact (contact, gtk_get_current_event_time (),
+      chat_cb, NULL);
 
   g_object_unref (contact);
 }