call-window: properly remove the fs element notifiers
[empathy-mirror.git] / libempathy-gtk / empathy-share-my-desktop.c
blob07edfce469a79b10ac14af61af1ea7055a4259ec
1 /*
2 * © 2009, Collabora Ltd
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 * Authors: Arnaud Maillet <arnaud.maillet@collabora.co.uk>
21 #include "config.h"
22 #include "empathy-share-my-desktop.h"
24 #include <telepathy-glib/telepathy-glib-dbus.h>
26 #define DEBUG_FLAG EMPATHY_DEBUG_SHARE_DESKTOP
27 #include "empathy-debug.h"
29 static void
30 create_tube_channel_cb (GObject *source,
31 GAsyncResult *result,
32 gpointer user_data)
34 GError *error = NULL;
36 if (!tp_account_channel_request_create_channel_finish (
37 TP_ACCOUNT_CHANNEL_REQUEST (source), result, &error))
39 DEBUG ("Failed to create tube channel: %s", error->message);
40 g_error_free (error);
44 void
45 empathy_share_my_desktop_share_with_contact (EmpathyContact *contact)
47 TpAccountChannelRequest *req;
48 TpContact *tp_contact;
50 tp_contact = empathy_contact_get_tp_contact (contact);
52 DEBUG ("Creation of ShareMyDesktop");
54 if (!TP_IS_CONTACT (tp_contact))
56 DEBUG ("It's not a tp contact");
57 return;
60 req = tp_account_channel_request_new_stream_tube (
61 empathy_contact_get_account (contact), "rfb",
62 TP_USER_ACTION_TIME_CURRENT_TIME);
64 tp_account_channel_request_set_target_contact (req, tp_contact);
66 tp_account_channel_request_create_channel_async (req, NULL, NULL,
67 create_tube_channel_cb, NULL);
69 g_object_unref (req);