aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-04-25 00:16:32 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-04-25 02:44:09 +0800
commit54ae82bdf32156387e3d720656bd361a859b8db6 (patch)
tree3b634c9ed82c0dcb3685ce21d2097df9d6c9d3dd
parent985a3c10e9fa40d2023f73df03d7709816bf0ecc (diff)
downloadgsoc2013-empathy-54ae82bdf32156387e3d720656bd361a859b8db6.tar
gsoc2013-empathy-54ae82bdf32156387e3d720656bd361a859b8db6.tar.gz
gsoc2013-empathy-54ae82bdf32156387e3d720656bd361a859b8db6.tar.bz2
gsoc2013-empathy-54ae82bdf32156387e3d720656bd361a859b8db6.tar.lz
gsoc2013-empathy-54ae82bdf32156387e3d720656bd361a859b8db6.tar.xz
gsoc2013-empathy-54ae82bdf32156387e3d720656bd361a859b8db6.tar.zst
gsoc2013-empathy-54ae82bdf32156387e3d720656bd361a859b8db6.zip
add timestamp arg to empathy_dispatcher_chat_with_contact(_id)
-rw-r--r--libempathy-gtk/empathy-chat.c3
-rw-r--r--libempathy-gtk/empathy-contact-list-view.c3
-rw-r--r--libempathy-gtk/empathy-contact-menu.c3
-rw-r--r--libempathy-gtk/empathy-new-message-dialog.c3
-rw-r--r--libempathy/empathy-dispatcher.c11
-rw-r--r--libempathy/empathy-dispatcher.h8
-rw-r--r--src/empathy-chat-manager.c2
-rw-r--r--src/empathy-chat-window.c2
-rw-r--r--tests/interactive/empetit.c3
9 files changed, 25 insertions, 13 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index b06329a67..06ee4bbe7 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -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);
}
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 15df212ce..ae84e3e15 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -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);
}
}
diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c
index fbcd8dc8a..e160f5e20 100644
--- a/libempathy-gtk/empathy-contact-menu.c
+++ b/libempathy-gtk/empathy-contact-menu.c
@@ -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 *
diff --git a/libempathy-gtk/empathy-new-message-dialog.c b/libempathy-gtk/empathy-new-message-dialog.c
index 338da2760..509438575 100644
--- a/libempathy-gtk/empathy-new-message-dialog.c
+++ b/libempathy-gtk/empathy-new-message-dialog.c
@@ -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));
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c
index 046f6a981..40ee5dd88 100644
--- a/libempathy/empathy-dispatcher.c
+++ b/libempathy/empathy-dispatcher.c
@@ -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);
diff --git a/libempathy/empathy-dispatcher.h b/libempathy/empathy-dispatcher.h
index 97ac49bea..b3e9e1dda 100644
--- a/libempathy/empathy-dispatcher.h
+++ b/libempathy/empathy-dispatcher.h
@@ -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,
diff --git a/src/empathy-chat-manager.c b/src/empathy-chat-manager.c
index 01506f52e..35b23244c 100644
--- a/src/empathy-chat-manager.c
+++ b/src/empathy-chat-manager.c
@@ -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));
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 6e80bb458..847c7f834 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -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);
diff --git a/tests/interactive/empetit.c b/tests/interactive/empetit.c
index e2eb61f66..7bcaf03ee 100644
--- a/tests/interactive/empetit.c
+++ b/tests/interactive/empetit.c
@@ -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);
}