2 * Copyright (C) 2007-2009 Collabora Ltd.
3 * Copyright (C) 2007 Marco Barisione <marco@barisione.org>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 * Authors: Marco Barisione <marco@barisione.org>
20 * Jonny Lamb <jonny.lamb@collabora.co.uk>
21 * Cosimo Cecchi <cosimo.cecchi@collabora.co.uk>
29 #include <sys/types.h>
30 #include <sys/socket.h>
33 #include <glib/gi18n-lib.h>
36 #include <gio/gunixinputstream.h>
37 #include <gio/gunixoutputstream.h>
39 #include <telepathy-glib/proxy-subclass.h>
40 #include <telepathy-glib/util.h>
42 #include "empathy-tp-file.h"
43 #include "empathy-marshal.h"
44 #include "empathy-time.h"
45 #include "empathy-utils.h"
47 #define DEBUG_FLAG EMPATHY_DEBUG_FT
48 #include "empathy-debug.h"
51 * SECTION:empathy-tp-file
52 * @title: EmpathyTpFile
53 * @short_description: Object which represents a Telepathy file channel
54 * @include: libempathy/empathy-tp-file.h
56 * #EmpathyTpFile is an object which represents a Telepathy file channel.
57 * Usually, clients do not need to deal with #EmpathyTpFile objects directly,
58 * and are supposed to use #EmpathyFTHandler and #EmpathyFTFactory for
59 * transferring files using libempathy.
62 /* EmpathyTpFile object */
68 GInputStream *in_stream;
69 GOutputStream *out_stream;
71 /* org.freedesktop.Telepathy.Channel.Type.FileTransfer D-Bus properties */
72 TpFileTransferState state;
73 TpFileTransferStateChangeReason state_change_reason;
75 /* transfer properties */
78 GArray *unix_socket_path;
81 /* GCancellable we're passed when offering/accepting the transfer */
82 GCancellable *cancellable;
84 /* callbacks for the operation */
85 EmpathyTpFileProgressCallback progress_callback;
86 gpointer progress_user_data;
87 EmpathyTpFileOperationCallback op_callback;
88 gpointer op_user_data;
101 #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyTpFile)
103 G_DEFINE_TYPE (EmpathyTpFile, empathy_tp_file, G_TYPE_OBJECT);
105 /* private functions */
108 tp_file_get_state_cb (TpProxy *proxy,
112 GObject *weak_object)
114 EmpathyTpFilePriv *priv = GET_PRIV (weak_object);
118 /* set a default value for the state */
119 priv->state = TP_FILE_TRANSFER_STATE_NONE;
123 priv->state = g_value_get_uint (value);
127 tp_file_invalidated_cb (TpProxy *proxy,
131 EmpathyTpFile *tp_file)
133 EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
135 DEBUG ("Channel invalidated: %s", message);
137 if (priv->state != TP_FILE_TRANSFER_STATE_COMPLETED &&
138 priv->state != TP_FILE_TRANSFER_STATE_CANCELLED)
140 /* The channel is not in a finished state, an error occured */
141 priv->state = TP_FILE_TRANSFER_STATE_CANCELLED;
142 priv->state_change_reason =
143 TP_FILE_TRANSFER_STATE_CHANGE_REASON_LOCAL_ERROR;
148 ft_operation_close_clean (EmpathyTpFile *tp_file)
150 EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
155 DEBUG ("FT operation close clean");
157 priv->is_closed = TRUE;
159 if (priv->op_callback != NULL)
160 priv->op_callback (tp_file, NULL, priv->op_user_data);
164 ft_operation_close_with_error (EmpathyTpFile *tp_file,
167 EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
172 DEBUG ("FT operation close with error %s", error->message);
174 priv->is_closed = TRUE;
176 /* close the channel if it's not cancelled already */
177 if (priv->state != TP_FILE_TRANSFER_STATE_CANCELLED)
178 empathy_tp_file_cancel (tp_file);
180 if (priv->op_callback != NULL)
181 priv->op_callback (tp_file, error, priv->op_user_data);
185 splice_stream_ready_cb (GObject *source,
189 EmpathyTpFile *tp_file;
190 GError *error = NULL;
194 g_output_stream_splice_finish (G_OUTPUT_STREAM (source), res, &error);
196 DEBUG ("Splice stream ready cb, error %p", error);
200 ft_operation_close_with_error (tp_file, error);
201 g_clear_error (&error);
207 tp_file_start_transfer (EmpathyTpFile *tp_file)
210 struct sockaddr_un addr;
211 GError *error = NULL;
212 EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
214 fd = socket (PF_UNIX, SOCK_STREAM, 0);
219 error = g_error_new_literal (EMPATHY_FT_ERROR_QUARK,
220 EMPATHY_FT_ERROR_SOCKET, g_strerror (code));
222 DEBUG ("Failed to create socket, closing channel");
224 ft_operation_close_with_error (tp_file, error);
225 g_clear_error (&error);
230 memset (&addr, 0, sizeof (addr));
231 addr.sun_family = AF_UNIX;
232 strncpy (addr.sun_path, priv->unix_socket_path->data,
233 priv->unix_socket_path->len);
235 if (connect (fd, (struct sockaddr*) &addr, sizeof (addr)) < 0)
239 error = g_error_new_literal (EMPATHY_FT_ERROR_QUARK,
240 EMPATHY_FT_ERROR_SOCKET, g_strerror (code));
242 DEBUG ("Failed to connect socket, closing channel");
244 ft_operation_close_with_error (tp_file, error);
246 g_clear_error (&error);
251 DEBUG ("Start the transfer");
253 priv->start_time = empathy_time_get_current ();
255 /* notify we're starting a transfer */
256 if (priv->progress_callback != NULL)
257 priv->progress_callback (tp_file, 0, priv->progress_user_data);
261 GInputStream *socket_stream;
263 socket_stream = g_unix_input_stream_new (fd, TRUE);
265 g_output_stream_splice_async (priv->out_stream, socket_stream,
266 G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE |
267 G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
268 G_PRIORITY_DEFAULT, priv->cancellable,
269 splice_stream_ready_cb, tp_file);
271 g_object_unref (socket_stream);
275 GOutputStream *socket_stream;
277 socket_stream = g_unix_output_stream_new (fd, TRUE);
279 g_output_stream_splice_async (socket_stream, priv->in_stream,
280 G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE |
281 G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET,
282 G_PRIORITY_DEFAULT, priv->cancellable,
283 splice_stream_ready_cb, tp_file);
285 g_object_unref (socket_stream);
290 error_from_state_change_reason (TpFileTransferStateChangeReason reason)
293 GError *retval = NULL;
299 case TP_FILE_TRANSFER_STATE_CHANGE_REASON_NONE:
300 string = _("No reason was specified");
302 case TP_FILE_TRANSFER_STATE_CHANGE_REASON_REQUESTED:
303 string = _("The change in state was requested");
305 case TP_FILE_TRANSFER_STATE_CHANGE_REASON_LOCAL_STOPPED:
306 string = _("You canceled the file transfer");
308 case TP_FILE_TRANSFER_STATE_CHANGE_REASON_REMOTE_STOPPED:
309 string = _("The other participant canceled the file transfer");
311 case TP_FILE_TRANSFER_STATE_CHANGE_REASON_LOCAL_ERROR:
312 string = _("Error while trying to transfer the file");
314 case TP_FILE_TRANSFER_STATE_CHANGE_REASON_REMOTE_ERROR:
315 string = _("The other participant is unable to transfer the file");
318 string = _("Unknown reason");
322 retval = g_error_new_literal (EMPATHY_FT_ERROR_QUARK,
323 EMPATHY_FT_ERROR_TP_ERROR, string);
329 tp_file_state_changed_cb (TpChannel *proxy,
333 GObject *weak_object)
335 EmpathyTpFilePriv *priv = GET_PRIV (weak_object);
336 GError *error = NULL;
338 if (state == priv->state)
341 DEBUG ("File transfer state changed:\n"
342 "old state = %u, state = %u, reason = %u\n"
343 "\tincoming = %s, in_stream = %s, out_stream = %s",
344 priv->state, state, reason,
345 priv->incoming ? "yes" : "no",
346 priv->in_stream ? "present" : "not present",
347 priv->out_stream ? "present" : "not present");
350 priv->state_change_reason = reason;
352 /* If the channel is open AND we have the socket path, we can start the
353 * transfer. The socket path could be NULL if we are not doing the actual
354 * data transfer but are just an observer for the channel.
356 if (state == TP_FILE_TRANSFER_STATE_OPEN &&
357 priv->unix_socket_path != NULL)
358 tp_file_start_transfer (EMPATHY_TP_FILE (weak_object));
360 if (state == TP_FILE_TRANSFER_STATE_COMPLETED)
361 ft_operation_close_clean (EMPATHY_TP_FILE (weak_object));
363 if (state == TP_FILE_TRANSFER_STATE_CANCELLED)
365 error = error_from_state_change_reason (priv->state_change_reason);
366 ft_operation_close_with_error (EMPATHY_TP_FILE (weak_object), error);
367 g_clear_error (&error);
372 tp_file_transferred_bytes_changed_cb (TpChannel *proxy,
375 GObject *weak_object)
377 EmpathyTpFilePriv *priv = GET_PRIV (weak_object);
379 /* don't notify for 0 bytes count */
384 if (priv->progress_callback != NULL)
385 priv->progress_callback (EMPATHY_TP_FILE (weak_object),
386 count, priv->progress_user_data);
390 ft_operation_provide_or_accept_file_cb (TpChannel *proxy,
391 const GValue *address,
394 GObject *weak_object)
396 EmpathyTpFile *tp_file = EMPATHY_TP_FILE (weak_object);
397 GError *myerr = NULL;
398 EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
400 g_cancellable_set_error_if_cancelled (priv->cancellable, &myerr);
406 /* if we were both cancelled and failed when calling the method,
407 * report the method error.
409 g_clear_error (&myerr);
410 myerr = g_error_copy (error);
416 DEBUG ("Error: %s", error->message);
417 ft_operation_close_with_error (tp_file, myerr);
418 g_clear_error (&myerr);
422 if (G_VALUE_TYPE (address) == DBUS_TYPE_G_UCHAR_ARRAY)
424 priv->unix_socket_path = g_value_dup_boxed (address);
426 else if (G_VALUE_TYPE (address) == G_TYPE_STRING)
428 /* Old bugged version of telepathy-salut used to store the address
429 * as a 's' instead of an 'ay' */
432 path = g_value_get_string (address);
433 priv->unix_socket_path = g_array_sized_new (TRUE, FALSE, sizeof (gchar),
435 g_array_insert_vals (priv->unix_socket_path, 0, path, strlen (path));
438 DEBUG ("Got unix socket path: %s", priv->unix_socket_path->data);
440 /* if the channel is already open, start the transfer now, otherwise,
441 * wait for the state change signal.
443 if (priv->state == TP_FILE_TRANSFER_STATE_OPEN)
444 tp_file_start_transfer (tp_file);
448 file_read_async_cb (GObject *source,
452 GValue nothing = { 0 };
453 EmpathyTpFile *tp_file = user_data;
454 EmpathyTpFilePriv *priv;
455 GFileInputStream *in_stream;
456 GError *error = NULL;
458 priv = GET_PRIV (tp_file);
460 in_stream = g_file_read_finish (G_FILE (source), res, &error);
464 ft_operation_close_with_error (tp_file, error);
465 g_clear_error (&error);
469 priv->in_stream = G_INPUT_STREAM (in_stream);
471 g_value_init (¬hing, G_TYPE_STRING);
472 g_value_set_static_string (¬hing, "");
474 tp_cli_channel_type_file_transfer_call_provide_file (
476 TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST,
477 ¬hing, ft_operation_provide_or_accept_file_cb,
478 NULL, NULL, G_OBJECT (tp_file));
482 file_replace_async_cb (GObject *source,
486 GValue nothing = { 0 };
487 EmpathyTpFile *tp_file = user_data;
488 EmpathyTpFilePriv *priv;
489 GError *error = NULL;
490 GFileOutputStream *out_stream;
492 priv = GET_PRIV (tp_file);
494 out_stream = g_file_replace_finish (G_FILE (source), res, &error);
498 ft_operation_close_with_error (tp_file, error);
499 g_clear_error (&error);
504 priv->out_stream = G_OUTPUT_STREAM (out_stream);
506 g_value_init (¬hing, G_TYPE_STRING);
507 g_value_set_static_string (¬hing, "");
509 tp_cli_channel_type_file_transfer_call_accept_file (priv->channel,
510 -1, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST,
511 ¬hing, priv->offset,
512 ft_operation_provide_or_accept_file_cb, NULL, NULL, G_OBJECT (tp_file));
516 channel_closed_cb (TpChannel *proxy,
519 GObject *weak_object)
521 EmpathyTpFile *tp_file = EMPATHY_TP_FILE (weak_object);
522 EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
523 gboolean cancel = GPOINTER_TO_INT (user_data);
525 DEBUG ("Channel is closed, should cancel %s", cancel ? "True" : "False");
527 if (priv->cancellable != NULL &&
528 !g_cancellable_is_cancelled (priv->cancellable) && cancel)
529 g_cancellable_cancel (priv->cancellable);
533 close_channel_internal (EmpathyTpFile *tp_file,
536 EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
538 DEBUG ("Closing channel, should cancel %s", cancel ?
541 tp_cli_channel_call_close (priv->channel, -1,
542 channel_closed_cb, GINT_TO_POINTER (cancel), NULL, G_OBJECT (tp_file));
545 /* GObject methods */
548 empathy_tp_file_init (EmpathyTpFile *tp_file)
550 EmpathyTpFilePriv *priv;
552 priv = G_TYPE_INSTANCE_GET_PRIVATE ((tp_file),
553 EMPATHY_TYPE_TP_FILE, EmpathyTpFilePriv);
555 tp_file->priv = priv;
559 do_dispose (GObject *object)
561 EmpathyTpFilePriv *priv = GET_PRIV (object);
563 if (priv->dispose_run)
566 priv->dispose_run = TRUE;
568 if (priv->channel != NULL)
570 g_signal_handlers_disconnect_by_func (priv->channel,
571 tp_file_invalidated_cb, object);
572 g_object_unref (priv->channel);
573 priv->channel = NULL;
576 if (priv->in_stream != NULL)
577 g_object_unref (priv->in_stream);
579 if (priv->out_stream != NULL)
580 g_object_unref (priv->out_stream);
582 if (priv->cancellable != NULL)
583 g_object_unref (priv->cancellable);
585 G_OBJECT_CLASS (empathy_tp_file_parent_class)->dispose (object);
589 do_finalize (GObject *object)
591 EmpathyTpFilePriv *priv = GET_PRIV (object);
593 DEBUG ("%p", object);
595 if (priv->unix_socket_path != NULL)
597 g_array_free (priv->unix_socket_path, TRUE);
598 priv->unix_socket_path = NULL;
601 G_OBJECT_CLASS (empathy_tp_file_parent_class)->finalize (object);
605 do_get_property (GObject *object,
610 EmpathyTpFilePriv *priv = GET_PRIV (object);
615 g_value_set_object (value, priv->channel);
618 g_value_set_boolean (value, priv->incoming);
621 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
627 do_set_property (GObject *object,
632 EmpathyTpFilePriv *priv = GET_PRIV (object);
636 priv->channel = g_object_ref (g_value_get_object (value));
639 priv->incoming = g_value_get_boolean (value);
642 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
648 do_constructed (GObject *object)
650 EmpathyTpFile *tp_file;
651 EmpathyTpFilePriv *priv;
653 tp_file = EMPATHY_TP_FILE (object);
654 priv = GET_PRIV (tp_file);
656 g_signal_connect (priv->channel, "invalidated",
657 G_CALLBACK (tp_file_invalidated_cb), tp_file);
659 tp_cli_channel_type_file_transfer_connect_to_file_transfer_state_changed (
660 priv->channel, tp_file_state_changed_cb, NULL, NULL, object, NULL);
662 tp_cli_channel_type_file_transfer_connect_to_transferred_bytes_changed (
663 priv->channel, tp_file_transferred_bytes_changed_cb,
664 NULL, NULL, object, NULL);
666 tp_cli_dbus_properties_call_get (priv->channel,
667 -1, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "State", tp_file_get_state_cb,
670 priv->state_change_reason =
671 TP_FILE_TRANSFER_STATE_CHANGE_REASON_NONE;
675 empathy_tp_file_class_init (EmpathyTpFileClass *klass)
677 GObjectClass *object_class = G_OBJECT_CLASS (klass);
679 object_class->finalize = do_finalize;
680 object_class->dispose = do_dispose;
681 object_class->constructed = do_constructed;
682 object_class->get_property = do_get_property;
683 object_class->set_property = do_set_property;
685 /* Construct-only properties */
688 * EmpathyTpFile:channel:
690 * The #TpChannel requested for the file transfer.
692 g_object_class_install_property (object_class,
694 g_param_spec_object ("channel",
696 "The file transfer channel",
699 G_PARAM_CONSTRUCT_ONLY));
702 * EmpathyTpFile:incoming:
704 * %TRUE if the transfer is incoming, %FALSE if it's outgoing.
706 g_object_class_install_property (object_class,
708 g_param_spec_boolean ("incoming",
709 "direction of transfer",
710 "The direction of the file being transferred",
713 G_PARAM_CONSTRUCT_ONLY));
715 g_type_class_add_private (object_class, sizeof (EmpathyTpFilePriv));
721 * empathy_tp_file_new:
722 * @channel: a #TpChannel
723 * @incoming: whether the file transfer is incoming or not
725 * Creates a new #EmpathyTpFile wrapping @channel, with the direction
726 * specified by @incoming. The returned #EmpathyTpFile should be unrefed
727 * with g_object_unref() when finished with.
729 * Return value: a new #EmpathyTpFile
732 empathy_tp_file_new (TpChannel *channel,
735 EmpathyTpFile *tp_file;
737 g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL);
739 tp_file = g_object_new (EMPATHY_TYPE_TP_FILE,
740 "channel", channel, "incoming", incoming,
747 * empathy_tp_file_accept:
748 * @tp_file: an incoming #EmpathyTpFile
749 * @offset: the offset of @gfile where we should start writing
750 * @gfile: the destination #GFile for the transfer
751 * @cancellable: a #GCancellable
752 * @progress_callback: function to callback with progress information
753 * @progress_user_data: user_data to pass to @progress_callback
754 * @op_callback: function to callback when the transfer ends
755 * @op_user_data: user_data to pass to @op_callback
757 * Accepts an incoming file transfer, saving the result into @gfile.
758 * The callback @op_callback will be called both when the transfer is
759 * successful and in case of an error. Note that cancelling @cancellable,
760 * closes the socket of the file operation in progress, but doesn't
761 * guarantee that the transfer channel will be closed as well. Thus,
762 * empathy_tp_file_cancel() or empathy_tp_file_close() should be used to
763 * actually cancel an ongoing #EmpathyTpFile.
766 empathy_tp_file_accept (EmpathyTpFile *tp_file,
769 GCancellable *cancellable,
770 EmpathyTpFileProgressCallback progress_callback,
771 gpointer progress_user_data,
772 EmpathyTpFileOperationCallback op_callback,
773 gpointer op_user_data)
775 EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
777 g_return_if_fail (EMPATHY_IS_TP_FILE (tp_file));
778 g_return_if_fail (G_IS_FILE (gfile));
779 g_return_if_fail (G_IS_CANCELLABLE (cancellable));
781 priv->cancellable = g_object_ref (cancellable);
782 priv->progress_callback = progress_callback;
783 priv->progress_user_data = progress_user_data;
784 priv->op_callback = op_callback;
785 priv->op_user_data = op_user_data;
786 priv->offset = offset;
788 g_file_replace_async (gfile, NULL, FALSE, G_FILE_CREATE_NONE,
789 G_PRIORITY_DEFAULT, cancellable, file_replace_async_cb, tp_file);
794 * empathy_tp_file_offer:
795 * @tp_file: an outgoing #EmpathyTpFile
796 * @gfile: the source #GFile for the transfer
797 * @cancellable: a #GCancellable
798 * @progress_callback: function to callback with progress information
799 * @progress_user_data: user_data to pass to @progress_callback
800 * @op_callback: function to callback when the transfer ends
801 * @op_user_data: user_data to pass to @op_callback
803 * Offers an outgoing file transfer, reading data from @gfile.
804 * The callback @op_callback will be called both when the transfer is
805 * successful and in case of an error. Note that cancelling @cancellable,
806 * closes the socket of the file operation in progress, but doesn't
807 * guarantee that the transfer channel will be closed as well. Thus,
808 * empathy_tp_file_cancel() or empathy_tp_file_close() should be used to
809 * actually cancel an ongoing #EmpathyTpFile.
812 empathy_tp_file_offer (EmpathyTpFile *tp_file,
814 GCancellable *cancellable,
815 EmpathyTpFileProgressCallback progress_callback,
816 gpointer progress_user_data,
817 EmpathyTpFileOperationCallback op_callback,
818 gpointer op_user_data)
820 EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
822 g_return_if_fail (EMPATHY_IS_TP_FILE (tp_file));
823 g_return_if_fail (G_IS_FILE (gfile));
824 g_return_if_fail (G_IS_CANCELLABLE (cancellable));
826 priv->cancellable = g_object_ref (cancellable);
827 priv->progress_callback = progress_callback;
828 priv->progress_user_data = progress_user_data;
829 priv->op_callback = op_callback;
830 priv->op_user_data = op_user_data;
832 g_file_read_async (gfile, G_PRIORITY_DEFAULT, cancellable,
833 file_read_async_cb, tp_file);
837 * empathy_tp_file_is_incoming:
838 * @tp_file: an #EmpathyTpFile
840 * Returns whether @tp_file is incoming.
842 * Return value: %TRUE if the @tp_file is incoming, otherwise %FALSE
845 empathy_tp_file_is_incoming (EmpathyTpFile *tp_file)
847 EmpathyTpFilePriv *priv;
849 g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file), FALSE);
851 priv = GET_PRIV (tp_file);
853 return priv->incoming;
857 * empathy_tp_file_cancel:
858 * @tp_file: an #EmpathyTpFile
860 * Cancels an ongoing #EmpathyTpFile, first closing the channel and then
861 * cancelling any I/O operation and closing the socket.
864 empathy_tp_file_cancel (EmpathyTpFile *tp_file)
866 g_return_if_fail (EMPATHY_IS_TP_FILE (tp_file));
868 close_channel_internal (tp_file, TRUE);
872 * empathy_tp_file_close:
873 * @tp_file: an #EmpathyTpFile
875 * Closes the channel for an ongoing #EmpathyTpFile. It's safe to call this
876 * method after the transfer has ended.
879 empathy_tp_file_close (EmpathyTpFile *tp_file)
881 g_return_if_fail (EMPATHY_IS_TP_FILE (tp_file));
883 close_channel_internal (tp_file, FALSE);