summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-05-12 11:09:37 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-05-12 12:19:13 +0200
commit839dbb282cfa395be8d144eb8d433e9fb5fdef08 (patch)
tree6127795f962288839b60ad4f7aab787ebfe76cc2
parent74ce4ee413292d40eaab8671ef1933ba9560722f (diff)
downloadempathy-839dbb282cfa395be8d144eb8d433e9fb5fdef08.tar.gz
Properly convert timestamps received from X11 (#650015)
X11 timestamps are guint32 while Telepathy uses gint64 timestamps. We should always use tp_user_action_time_from_x11() to do the conversion.
-rw-r--r--libempathy-gtk/empathy-chat.c4
-rw-r--r--libempathy-gtk/empathy-contact-list-view.c2
-rw-r--r--libempathy-gtk/empathy-contact-menu.c7
-rw-r--r--libempathy-gtk/empathy-individual-menu.c6
-rw-r--r--libempathy-gtk/empathy-new-call-dialog.c3
-rw-r--r--libempathy-gtk/empathy-new-message-dialog.c2
-rw-r--r--src/empathy-chat-window.c2
-rw-r--r--src/empathy-event-manager.c3
-rw-r--r--src/empathy-main-window.c4
-rw-r--r--src/empathy-new-chatroom-dialog.c4
-rw-r--r--src/empathy-streamed-media-window.c2
11 files changed, 20 insertions, 19 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index b7c5192a8..002582122 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -737,7 +737,7 @@ empathy_chat_join_muc (EmpathyChat *chat,
EmpathyChatPriv *priv = GET_PRIV (chat);
empathy_join_muc (priv->account, room,
- gtk_get_current_event_time ());
+ empathy_get_current_action_time ());
}
static void
@@ -808,7 +808,7 @@ chat_command_msg_internal (EmpathyChat *chat,
NULL);
req = tp_account_channel_request_new (priv->account, request,
- tp_user_action_time_from_x11 (gtk_get_current_event_time ()));
+ empathy_get_current_action_time ());
/* FIXME: We should probably search in members alias. But this
* is enough for IRC */
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index dace4f909..03839abbe 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -903,7 +903,7 @@ contact_list_view_row_activated (GtkTreeView *view,
if (contact) {
DEBUG ("Starting a chat");
empathy_chat_with_contact (contact,
- gtk_get_current_event_time ());
+ empathy_get_current_action_time ());
g_object_unref (contact);
}
}
diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c
index 15f47b206..ecdbee1ba 100644
--- a/libempathy-gtk/empathy-contact-menu.c
+++ b/libempathy-gtk/empathy-contact-menu.c
@@ -314,7 +314,7 @@ static void
empathy_contact_chat_menu_item_activated (GtkMenuItem *item,
EmpathyContact *contact)
{
- empathy_chat_with_contact (contact, gtk_get_current_event_time ());
+ empathy_chat_with_contact (contact, empathy_get_current_action_time ());
}
GtkWidget *
@@ -343,9 +343,8 @@ static void
empathy_contact_audio_call_menu_item_activated (GtkMenuItem *item,
EmpathyContact *contact)
{
-
empathy_call_new_with_streams (contact, TRUE, FALSE,
- gtk_get_current_event_time ());
+ empathy_get_current_action_time ());
}
GtkWidget *
@@ -376,7 +375,7 @@ empathy_contact_video_call_menu_item_activated (GtkMenuItem *item,
EmpathyContact *contact)
{
empathy_call_new_with_streams (contact, TRUE, TRUE,
- gtk_get_current_event_time ());
+ empathy_get_current_action_time ());
}
GtkWidget *
diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c
index 3e404c39f..21f983f39 100644
--- a/libempathy-gtk/empathy-individual-menu.c
+++ b/libempathy-gtk/empathy-individual-menu.c
@@ -499,7 +499,7 @@ empathy_individual_chat_menu_item_activated (GtkMenuItem *item,
{
g_return_if_fail (EMPATHY_IS_CONTACT (contact));
- empathy_chat_with_contact (contact, gtk_get_current_event_time ());
+ empathy_chat_with_contact (contact, empathy_get_current_action_time ());
}
GtkWidget *
@@ -543,7 +543,7 @@ empathy_individual_audio_call_menu_item_activated (GtkMenuItem *item,
g_return_if_fail (EMPATHY_IS_CONTACT (contact));
empathy_call_new_with_streams (contact, TRUE, FALSE,
- gtk_get_current_event_time ());
+ empathy_get_current_action_time ());
}
GtkWidget *
@@ -585,7 +585,7 @@ empathy_individual_video_call_menu_item_activated (GtkMenuItem *item,
g_return_if_fail (EMPATHY_IS_CONTACT (contact));
empathy_call_new_with_streams (contact, TRUE, TRUE,
- gtk_get_current_event_time ());
+ empathy_get_current_action_time ());
}
GtkWidget *
diff --git a/libempathy-gtk/empathy-new-call-dialog.c b/libempathy-gtk/empathy-new-call-dialog.c
index fbff2770e..86430cd24 100644
--- a/libempathy-gtk/empathy-new-call-dialog.c
+++ b/libempathy-gtk/empathy-new-call-dialog.c
@@ -134,7 +134,8 @@ empathy_new_call_dialog_response (GtkDialog *dialog, int response_id)
* we return from this function. */
video = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_video));
- call_contact (account, contact_id, video, gtk_get_current_event_time ());
+ call_contact (account, contact_id, video,
+ empathy_get_current_action_time ());
out:
gtk_widget_destroy (GTK_WIDGET (dialog));
diff --git a/libempathy-gtk/empathy-new-message-dialog.c b/libempathy-gtk/empathy-new-message-dialog.c
index b9edb93e7..b205e5344 100644
--- a/libempathy-gtk/empathy-new-message-dialog.c
+++ b/libempathy-gtk/empathy-new-message-dialog.c
@@ -76,7 +76,7 @@ empathy_new_message_dialog_response (GtkDialog *dialog, int response_id)
if (EMP_STR_EMPTY (contact_id) || account == NULL) goto out;
empathy_chat_with_contact_id (account, contact_id,
- gtk_get_current_event_time ());
+ empathy_get_current_action_time ());
out:
gtk_widget_destroy (GTK_WIDGET (dialog));
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index c203be9e7..7c3ea5784 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -1786,7 +1786,7 @@ chat_window_drag_data_received (GtkWidget *widget,
if (!chat) {
empathy_chat_with_contact_id (
- account, contact_id, gtk_get_current_event_time ());
+ account, contact_id, empathy_get_current_action_time ());
g_strfreev (strv);
return;
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index 342d3e11e..871dd9d2f 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -43,6 +43,7 @@
#include <libempathy-gtk/empathy-images.h>
#include <libempathy-gtk/empathy-contact-dialogs.h>
#include <libempathy-gtk/empathy-sound-manager.h>
+#include <libempathy-gtk/empathy-ui-utils.h>
#include "empathy-event-manager.h"
#include "empathy-main-window.h"
@@ -316,7 +317,7 @@ event_manager_approval_approve (EventManagerApproval *approval)
}
else
{
- timestamp = tp_user_action_time_from_x11 (gtk_get_current_event_time ());
+ timestamp = empathy_get_current_action_time ();
}
g_assert (approval->operation != NULL);
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 851a424ea..231b1e1bb 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -1253,7 +1253,7 @@ main_window_favorite_chatroom_join (EmpathyChatroom *chatroom)
join_fav_account_sig_ctx *ctx;
ctx = join_fav_account_sig_ctx_new (account, chatroom,
- gtk_get_current_event_time ());
+ empathy_get_current_action_time ());
ctx->sig_id = g_signal_connect_data (account, "status-changed",
G_CALLBACK (account_status_changed_cb), ctx,
@@ -1264,7 +1264,7 @@ main_window_favorite_chatroom_join (EmpathyChatroom *chatroom)
return;
}
- join_chatroom (chatroom, gtk_get_current_event_time ());
+ join_chatroom (chatroom, empathy_get_current_action_time ());
}
static void
diff --git a/src/empathy-new-chatroom-dialog.c b/src/empathy-new-chatroom-dialog.c
index f27e8de03..eedab6226 100644
--- a/src/empathy-new-chatroom-dialog.c
+++ b/src/empathy-new-chatroom-dialog.c
@@ -690,8 +690,8 @@ new_chatroom_dialog_join (EmpathyNewChatroomDialog *dialog)
g_strstrip (room_name);
DEBUG ("Requesting channel for '%s'", room_name);
- empathy_join_muc (account, room_name,
- gtk_get_current_event_time ());
+
+ empathy_join_muc (account, room_name, empathy_get_current_action_time ());
g_free (room_name);
}
diff --git a/src/empathy-streamed-media-window.c b/src/empathy-streamed-media-window.c
index bb6df685c..c275388c7 100644
--- a/src/empathy-streamed-media-window.c
+++ b/src/empathy-streamed-media-window.c
@@ -2709,7 +2709,7 @@ start_call (EmpathyStreamedMediaWindow *self)
priv->call_started = TRUE;
empathy_streamed_media_handler_start_call (priv->handler,
- gtk_get_current_event_time ());
+ empathy_get_current_action_time ());
if (empathy_streamed_media_handler_has_initial_video (priv->handler))
{