From d8d74645987b0188f437b967c7d88dd3fda2db13 Mon Sep 17 00:00:00 2001 From: Danielle Madeley Date: Mon, 14 Dec 2009 14:48:08 +1100 Subject: Use EmpathyDispatcher to create the PMUC channel --- src/empathy-chat-window.c | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) (limited to 'src/empathy-chat-window.c') diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index bdc1a0196..26829a3bb 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -819,29 +819,12 @@ chat_window_contacts_toggled_cb (GtkToggleAction *toggle_action, empathy_chat_set_show_contacts (priv->current_chat, active); } -static void -upgrade_to_muc_cb (TpConnection *connection, - gboolean yours, - const char *object_path, - GHashTable *properties, - const GError *error, - gpointer user_data, - GObject *window) -{ - if (error) - { - g_critical ("%s", error->message); - return; - } - - g_print ("GOT CHANNEL! %s\n", object_path); -} - static void chat_window_invite_participant_activate_cb (GtkAction *action, EmpathyChatWindow *window) { EmpathyChatWindowPriv *priv; + EmpathyDispatcher *dispatcher = empathy_dispatcher_dup_singleton (); EmpathyTpChat *tp_chat; TpConnection *connection; TpChannel *channel; @@ -849,8 +832,6 @@ chat_window_invite_participant_activate_cb (GtkAction *action, GPtrArray *channels; char *invitees[3] = { NULL, }; - g_print ("INVITE PARTICIPANT\n"); - priv = GET_PRIV (window); g_return_if_fail (priv->current_chat != NULL); @@ -881,13 +862,14 @@ chat_window_invite_participant_activate_cb (GtkAction *action, /* FIXME: InvitationMessage ? */ NULL); - /* FIXME: this probably needs to go through EmpathyDispatcher */ - tp_cli_connection_interface_requests_call_ensure_channel ( - connection, -1, props, upgrade_to_muc_cb, NULL, NULL, - G_OBJECT (window)); + /* Although this is a MUC, it's anonymous, so CreateChannel is valid */ + empathy_dispatcher_create_channel (dispatcher, connection, + props, NULL, NULL); g_hash_table_destroy (props); g_ptr_array_free (channels, TRUE); + + g_object_unref (dispatcher); } static void -- cgit v1.2.3