]> git.0d.be Git - empathy.git/commitdiff
Properly convert timestamps received from X11 (#650015)
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 12 May 2011 09:09:37 +0000 (11:09 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 12 May 2011 10:05:13 +0000 (12:05 +0200)
X11 timestamps are guint32 while Telepathy uses gint64 timestamps. We should
always use tp_user_action_time_from_x11() to do the conversion.

libempathy-gtk/empathy-chat.c
libempathy-gtk/empathy-contact-list-view.c
libempathy-gtk/empathy-contact-menu.c
libempathy-gtk/empathy-individual-menu.c
libempathy-gtk/empathy-new-call-dialog.c
libempathy-gtk/empathy-new-message-dialog.c
src/empathy-chat-window.c
src/empathy-event-manager.c
src/empathy-main-window.c
src/empathy-new-chatroom-dialog.c
src/empathy-streamed-media-window.c

index b580812accfb14910af8ec9bae3fbce0646503cb..8ce698f028f6804e27f7a38973d271276c04b493 100644 (file)
@@ -753,7 +753,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
@@ -824,7 +824,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 */
index dace4f9090041b64c2e557c56dbd7e71a9af9887..03839abbe29926517e5d52afe283e038cec53b35 100644 (file)
@@ -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);
        }
 }
index 15f47b20659654d0f08afb498047010103def66e..ecdbee1ba53cb5e19973ef3c45047eb31b20af23 100644 (file)
@@ -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 *
index 576d3b9fac12b115d0e729a3b6ddbde0d0ea70de..4a0b45cab5e2f6197aebc08f95533589501e17ed 100644 (file)
@@ -518,7 +518,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 *
@@ -564,7 +564,7 @@ empathy_individual_sms_menu_item_activated (GtkMenuItem *item,
   empathy_sms_contact_id (
       empathy_contact_get_account (contact),
       empathy_contact_get_id (contact),
-      gtk_get_current_event_time ());
+      empathy_get_current_action_time ());
 }
 
 GtkWidget *
@@ -608,7 +608,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 *
@@ -650,7 +650,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 *
index fbff2770eda31039a3fb491f062fc95fdc52a0b5..86430cd2416c230156b03a2be9966b45a2abe0e3 100644 (file)
@@ -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));
index 3d811abbbc61caf98bdceb2803bd2f08f21b797e..f3186ccf9f8162a208904859f0329c330cb7de72 100644 (file)
@@ -85,12 +85,12 @@ empathy_new_message_dialog_response (GtkDialog *dialog, int response_id)
     {
       case EMP_NEW_MESSAGE_TEXT:
         empathy_chat_with_contact_id (account, contact_id,
-            gtk_get_current_event_time ());
+            empathy_get_current_action_time ());
         break;
 
       case EMP_NEW_MESSAGE_SMS:
         empathy_sms_contact_id (account, contact_id,
-            gtk_get_current_event_time ());
+            empathy_get_current_action_time ());
         break;
 
       default:
index e5444b6a42cde96d9a080019bb53afc67dfeb251..f4a9f7e74ec2ff917bb0d8cbf4bf6a2c57873823 100644 (file)
@@ -1826,7 +1826,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;
index 2786e073861afea53f9b39da2054d0e522040a99..00d2c8ab818dc59dba75c9bead9d06ec0372ae12 100644 (file)
@@ -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);
index 0cef0e10f47b06842b26f9666e47a7e7f3b3af48..0ac08c856e2d0f15a7d22215bb51f5a3477d4fd2 100644 (file)
@@ -1584,7 +1584,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,
@@ -1595,7 +1595,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
index 388a1e506843cad564f51765535b487e75fb0d32..a09a5f7106d4939e1fb6ab7f5f45d10f076ad841 100644 (file)
@@ -683,8 +683,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);
 }
index 50d3f8aced50ffd7070d2beec0db8ebd78fc7f28..100a6b9f1dd7e9dca0ed96424fe9bcca604f2c95 100644 (file)
@@ -2713,7 +2713,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))
     {