]> git.0d.be Git - empathy.git/commitdiff
remove empathy_tp_file_is_incoming()
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 21 Sep 2011 14:02:36 +0000 (16:02 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 27 Sep 2011 13:11:27 +0000 (15:11 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=658245

libempathy/empathy-ft-handler.c
libempathy/empathy-tp-file.c
libempathy/empathy-tp-file.h

index 83557d480f8ce5947403243239d64fc6517faedd..1b4edcc565e14232ff1f9d5a5c006198845669da 100644 (file)
@@ -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);
 }
 
 /**
index d6d565654e0cce32ca32bb9492e53d3a16ca8aa3..7698ce7e1016fd7f70b9825d0fc6550473c1cf91 100644 (file)
@@ -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
index 7d8520426ea654bac1176bf04db23d6cfffe2000..6afb806df201ad3f1059db69603092d17f147959 100644 (file)
@@ -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__ */