]> git.0d.be Git - empathy.git/commitdiff
Set the user action time when the user approves stuff
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Tue, 4 May 2010 10:49:05 +0000 (11:49 +0100)
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>
Tue, 4 May 2010 10:49:05 +0000 (11:49 +0100)
libempathy/empathy-dispatch-operation.c
libempathy/empathy-dispatch-operation.h
src/empathy-event-manager.c

index 6c5fa38d89f8f19c3f58b60256ad035a612fcbbc..08013889ed9c7e1aa22533b1b509ba9de368f6c9 100644 (file)
@@ -702,6 +702,16 @@ empathy_dispatch_operation_is_incoming (EmpathyDispatchOperation *operation)
   return priv->incoming;
 }
 
+void
+empathy_dispatch_operation_set_user_action_time (
+    EmpathyDispatchOperation *self,
+    gint64 user_action_time)
+{
+  EmpathyDispatchOperationPriv *priv = GET_PRIV (self);
+
+  priv->user_action_time = user_action_time;
+}
+
 gint64
 empathy_dispatch_operation_get_user_action_time (EmpathyDispatchOperation *self)
 {
index 3e7bc92c56a95893838b28ab45a6a8ef6d68362b..f199be5213afea9cdc121a339a53c626f0ed697a 100644 (file)
@@ -118,6 +118,10 @@ EmpathyDispatchOperationState empathy_dispatch_operation_get_status (
 gboolean empathy_dispatch_operation_is_incoming (
   EmpathyDispatchOperation *operation);
 
+void empathy_dispatch_operation_set_user_action_time (
+    EmpathyDispatchOperation *self,
+    gint64 user_action_time);
+
 gint64 empathy_dispatch_operation_get_user_action_time (
     EmpathyDispatchOperation *self);
 
index c4ab4ad78b02df8b15b55d045a599344b221f1ac..a7da44f5e4cad37daa215f29f469933f326c20cf 100644 (file)
@@ -228,6 +228,12 @@ event_manager_add (EmpathyEventManager *manager,
 static void
 event_channel_process_func (EventPriv *event)
 {
+  gint64 timestamp = gtk_get_current_event_time ();
+  if (timestamp == GDK_CURRENT_TIME)
+    timestamp = G_MAXINT64;
+
+  empathy_dispatch_operation_set_user_action_time (event->approval->operation,
+    timestamp);
   empathy_dispatch_operation_approve (event->approval->operation);
 }
 
@@ -235,6 +241,12 @@ static void
 event_text_channel_process_func (EventPriv *event)
 {
   EmpathyTpChat *tp_chat;
+  gint64 timestamp = gtk_get_current_event_time ();
+  if (timestamp == GDK_CURRENT_TIME)
+    timestamp = G_MAXINT64;
+
+  empathy_dispatch_operation_set_user_action_time (event->approval->operation,
+    timestamp);
 
   if (event->approval->handler != 0)
     {
@@ -527,6 +539,7 @@ invite_dialog_response_cb (GtkDialog *dialog,
   TpChannel *channel;
   TpHandle self_handle;
   GArray *members;
+  gint64 timestamp;
 
   gtk_widget_destroy (GTK_WIDGET (approval->dialog));
   approval->dialog = NULL;
@@ -556,6 +569,12 @@ invite_dialog_response_cb (GtkDialog *dialog,
   tp_cli_channel_interface_group_call_add_members (channel, -1, members,
       "", NULL, NULL, NULL, NULL);
 
+  timestamp = gtk_get_current_event_time ();
+  if (timestamp == GDK_CURRENT_TIME)
+    timestamp = G_MAXINT64;
+
+  empathy_dispatch_operation_set_user_action_time (approval->operation,
+    timestamp);
   empathy_dispatch_operation_approve (approval->operation);
 
   g_array_free (members, TRUE);