From ef81d18e65bb14cbd98cf07eb9d899f9c628d70e Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 21 Sep 2011 16:02:36 +0200 Subject: remove empathy_tp_file_is_incoming() https://bugzilla.gnome.org/show_bug.cgi?id=658245 --- libempathy/empathy-ft-handler.c | 2 +- libempathy/empathy-tp-file.c | 23 ++--------------------- libempathy/empathy-tp-file.h | 2 -- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/libempathy/empathy-ft-handler.c b/libempathy/empathy-ft-handler.c index 83557d480..1b4edcc56 100644 --- a/libempathy/empathy-ft-handler.c +++ b/libempathy/empathy-ft-handler.c @@ -1589,7 +1589,7 @@ empathy_ft_handler_is_incoming (EmpathyFTHandler *handler) if (priv->tpfile == NULL) return FALSE; - return empathy_tp_file_is_incoming (priv->tpfile); + return !tp_channel_get_requested ((TpChannel *) priv->tpfile); } /** diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c index d6d565654..7698ce7e1 100644 --- a/libempathy/empathy-tp-file.c +++ b/libempathy/empathy-tp-file.c @@ -76,7 +76,6 @@ struct _EmpathyTpFilePrivate { TpSocketAccessControl socket_access_control; /* transfer properties */ - gboolean incoming; gint64 start_time; GArray *socket_address; guint port; @@ -335,7 +334,7 @@ tp_file_start_transfer (EmpathyTpFile *self) if (self->priv->progress_callback != NULL) self->priv->progress_callback (self, 0, self->priv->progress_user_data); - if (self->priv->incoming) + if (!tp_channel_get_requested ((TpChannel *) self)) { GInputStream *socket_stream; @@ -421,7 +420,7 @@ tp_file_state_changed_cb (TpChannel *proxy, "old state = %u, state = %u, reason = %u\n" "\tincoming = %s, in_stream = %s, out_stream = %s", self->priv->state, state, reason, - self->priv->incoming ? "yes" : "no", + tp_channel_get_requested (proxy) ? "no" : "yes", self->priv->in_stream ? "present" : "not present", self->priv->out_stream ? "present" : "not present"); @@ -723,8 +722,6 @@ do_constructed (GObject *object) g_signal_connect (self, "invalidated", G_CALLBACK (tp_file_invalidated_cb), self); - self->priv->incoming = !tp_channel_get_requested (channel); - tp_cli_channel_type_file_transfer_connect_to_file_transfer_state_changed ( channel, tp_file_state_changed_cb, NULL, NULL, object, NULL); @@ -868,22 +865,6 @@ empathy_tp_file_offer (EmpathyTpFile *self, file_read_async_cb, self); } -/** - * empathy_tp_file_is_incoming: - * @self: an #EmpathyTpFile - * - * Returns whether @self is incoming. - * - * Return value: %TRUE if the @self is incoming, otherwise %FALSE - */ -gboolean -empathy_tp_file_is_incoming (EmpathyTpFile *self) -{ - g_return_val_if_fail (EMPATHY_IS_TP_FILE (self), FALSE); - - return self->priv->incoming; -} - /** * empathy_tp_file_cancel: * @self: an #EmpathyTpFile diff --git a/libempathy/empathy-tp-file.h b/libempathy/empathy-tp-file.h index 7d8520426..6afb806df 100644 --- a/libempathy/empathy-tp-file.h +++ b/libempathy/empathy-tp-file.h @@ -122,8 +122,6 @@ void empathy_tp_file_offer (EmpathyTpFile *tp_file, void empathy_tp_file_cancel (EmpathyTpFile *tp_file); void empathy_tp_file_close (EmpathyTpFile *tp_file); -gboolean empathy_tp_file_is_incoming (EmpathyTpFile *tp_file); - G_END_DECLS #endif /* __EMPATHY_TP_FILE_H__ */ -- cgit v1.2.3