aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-05-04 18:49:05 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-05-04 18:49:05 +0800
commitda5288f52ae5af2100caff3fe80dd981d2333d32 (patch)
treeb5081dc7222ab9251007dbc24c42a76cb6331b29
parent86579ed008210dcdd95b0e0f92ab1648b0fd9494 (diff)
downloadgsoc2013-empathy-da5288f52ae5af2100caff3fe80dd981d2333d32.tar
gsoc2013-empathy-da5288f52ae5af2100caff3fe80dd981d2333d32.tar.gz
gsoc2013-empathy-da5288f52ae5af2100caff3fe80dd981d2333d32.tar.bz2
gsoc2013-empathy-da5288f52ae5af2100caff3fe80dd981d2333d32.tar.lz
gsoc2013-empathy-da5288f52ae5af2100caff3fe80dd981d2333d32.tar.xz
gsoc2013-empathy-da5288f52ae5af2100caff3fe80dd981d2333d32.tar.zst
gsoc2013-empathy-da5288f52ae5af2100caff3fe80dd981d2333d32.zip
Set the user action time when the user approves stuff
-rw-r--r--libempathy/empathy-dispatch-operation.c10
-rw-r--r--libempathy/empathy-dispatch-operation.h4
-rw-r--r--src/empathy-event-manager.c19
3 files changed, 33 insertions, 0 deletions
diff --git a/libempathy/empathy-dispatch-operation.c b/libempathy/empathy-dispatch-operation.c
index 6c5fa38d8..08013889e 100644
--- a/libempathy/empathy-dispatch-operation.c
+++ b/libempathy/empathy-dispatch-operation.c
@@ -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)
{
diff --git a/libempathy/empathy-dispatch-operation.h b/libempathy/empathy-dispatch-operation.h
index 3e7bc92c5..f199be521 100644
--- a/libempathy/empathy-dispatch-operation.h
+++ b/libempathy/empathy-dispatch-operation.h
@@ -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);
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index c4ab4ad78..a7da44f5e 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -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);