aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-01-31 21:34:21 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-09-27 21:11:27 +0800
commita93e738c107fc5b24c5055027c17559200734c23 (patch)
tree0448b4ba9f13f77f98c0dfea66ea814ec4795e84
parent32152c0067fea614d4aabd0a1f0f5bfa65216af1 (diff)
downloadgsoc2013-empathy-a93e738c107fc5b24c5055027c17559200734c23.tar
gsoc2013-empathy-a93e738c107fc5b24c5055027c17559200734c23.tar.gz
gsoc2013-empathy-a93e738c107fc5b24c5055027c17559200734c23.tar.bz2
gsoc2013-empathy-a93e738c107fc5b24c5055027c17559200734c23.tar.lz
gsoc2013-empathy-a93e738c107fc5b24c5055027c17559200734c23.tar.xz
gsoc2013-empathy-a93e738c107fc5b24c5055027c17559200734c23.tar.zst
gsoc2013-empathy-a93e738c107fc5b24c5055027c17559200734c23.zip
pass to proper user action time when requesting an outgoing FT
https://bugzilla.gnome.org/show_bug.cgi?id=658245
-rw-r--r--libempathy-gtk/empathy-ui-utils.c3
-rw-r--r--libempathy/empathy-ft-factory.c5
-rw-r--r--libempathy/empathy-ft-factory.h3
-rw-r--r--libempathy/empathy-ft-handler.c26
-rw-r--r--libempathy/empathy-ft-handler.h1
-rw-r--r--nautilus-sendto-plugin/empathy-nautilus-sendto.c2
6 files changed, 32 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index d5f63c9e0..3fde9e3e1 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1759,7 +1759,8 @@ empathy_send_file (EmpathyContact *contact, GFile *file)
factory = empathy_ft_factory_dup_singleton ();
- empathy_ft_factory_new_transfer_outgoing (factory, contact, file);
+ empathy_ft_factory_new_transfer_outgoing (factory, contact, file,
+ empathy_get_current_action_time ());
uri = g_file_get_uri (file);
manager = gtk_recent_manager_get_default ();
diff --git a/libempathy/empathy-ft-factory.c b/libempathy/empathy-ft-factory.c
index 597bbaf51..472451fa0 100644
--- a/libempathy/empathy-ft-factory.c
+++ b/libempathy/empathy-ft-factory.c
@@ -265,13 +265,14 @@ empathy_ft_factory_dup_singleton (void)
void
empathy_ft_factory_new_transfer_outgoing (EmpathyFTFactory *factory,
EmpathyContact *contact,
- GFile *source)
+ GFile *source,
+ gint64 action_time)
{
g_return_if_fail (EMPATHY_IS_FT_FACTORY (factory));
g_return_if_fail (EMPATHY_IS_CONTACT (contact));
g_return_if_fail (G_IS_FILE (source));
- empathy_ft_handler_new_outgoing (contact, source,
+ empathy_ft_handler_new_outgoing (contact, source, action_time,
ft_handler_outgoing_ready_cb, factory);
}
diff --git a/libempathy/empathy-ft-factory.h b/libempathy/empathy-ft-factory.h
index f59ecc44c..dcbffe1e1 100644
--- a/libempathy/empathy-ft-factory.h
+++ b/libempathy/empathy-ft-factory.h
@@ -62,7 +62,8 @@ GType empathy_ft_factory_get_type (void);
EmpathyFTFactory* empathy_ft_factory_dup_singleton (void);
void empathy_ft_factory_new_transfer_outgoing (EmpathyFTFactory *factory,
EmpathyContact *contact,
- GFile *source);
+ GFile *source,
+ gint64 user_action_time);
void empathy_ft_factory_set_destination_for_incoming_handler (
EmpathyFTFactory *factory,
EmpathyFTHandler *handler,
diff --git a/libempathy/empathy-ft-handler.c b/libempathy/empathy-ft-handler.c
index 99b6dc85f..8654bdd20 100644
--- a/libempathy/empathy-ft-handler.c
+++ b/libempathy/empathy-ft-handler.c
@@ -85,7 +85,8 @@ enum {
PROP_FILENAME,
PROP_MODIFICATION_TIME,
PROP_TOTAL_BYTES,
- PROP_TRANSFERRED_BYTES
+ PROP_TRANSFERRED_BYTES,
+ PROP_USER_ACTION_TIME
};
enum {
@@ -138,6 +139,8 @@ typedef struct {
gchar *content_hash;
TpFileHashType content_hash_type;
+ gint64 user_action_time;
+
/* time and speed */
gdouble speed;
guint remaining_time;
@@ -189,6 +192,9 @@ do_get_property (GObject *object,
case PROP_TP_FILE:
g_value_set_object (value, priv->tpfile);
break;
+ case PROP_USER_ACTION_TIME:
+ g_value_set_int64 (value, priv->user_action_time);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@@ -231,6 +237,9 @@ do_set_property (GObject *object,
case PROP_TP_FILE:
priv->tpfile = g_value_dup_object (value);
break;
+ case PROP_USER_ACTION_TIME:
+ priv->user_action_time = g_value_get_int64 (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@@ -412,6 +421,13 @@ empathy_ft_handler_class_init (EmpathyFTHandlerClass *klass)
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_property (object_class, PROP_TP_FILE, param_spec);
+ param_spec = g_param_spec_int64 ("user-action-time", "user action time",
+ "User action time",
+ 0, G_MAXINT64, 0,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY);
+ g_object_class_install_property (object_class, PROP_USER_ACTION_TIME,
+ param_spec);
+
/* signals */
/**
@@ -751,7 +767,7 @@ ft_handler_push_to_dispatcher (EmpathyFTHandler *handler)
account = empathy_contact_get_account (priv->contact);
req = tp_account_channel_request_new (account, priv->request,
- TP_USER_ACTION_TIME_NOT_USER_ACTION);
+ priv->user_action_time);
tp_account_channel_request_create_and_handle_channel_async (req, NULL,
ft_handler_create_channel_cb, handler);
@@ -1295,6 +1311,7 @@ channel_get_all_properties_cb (TpProxy *proxy,
void
empathy_ft_handler_new_outgoing (EmpathyContact *contact,
GFile *source,
+ gint64 action_time,
EmpathyFTHandlerReadyCallback callback,
gpointer user_data)
{
@@ -1308,7 +1325,10 @@ empathy_ft_handler_new_outgoing (EmpathyContact *contact,
g_return_if_fail (G_IS_FILE (source));
handler = g_object_new (EMPATHY_TYPE_FT_HANDLER,
- "contact", contact, "gfile", source, NULL);
+ "contact", contact,
+ "gfile", source,
+ "user-action-time", action_time,
+ NULL);
priv = GET_PRIV (handler);
diff --git a/libempathy/empathy-ft-handler.h b/libempathy/empathy-ft-handler.h
index 7d4153611..a4392b508 100644
--- a/libempathy/empathy-ft-handler.h
+++ b/libempathy/empathy-ft-handler.h
@@ -71,6 +71,7 @@ GType empathy_ft_handler_get_type (void);
/* public methods */
void empathy_ft_handler_new_outgoing (EmpathyContact *contact,
GFile *source,
+ gint64 action_time,
EmpathyFTHandlerReadyCallback callback,
gpointer user_data);
diff --git a/nautilus-sendto-plugin/empathy-nautilus-sendto.c b/nautilus-sendto-plugin/empathy-nautilus-sendto.c
index c480e02f7..cce55f8a0 100644
--- a/nautilus-sendto-plugin/empathy-nautilus-sendto.c
+++ b/nautilus-sendto-plugin/empathy-nautilus-sendto.c
@@ -210,7 +210,7 @@ send_files (NstPlugin *plugin,
++transfers;
empathy_ft_factory_new_transfer_outgoing (factory,
- contact, file);
+ contact, file, empathy_get_current_action_time ());
g_object_unref (file);
}