]> git.0d.be Git - empathy.git/commitdiff
Use EmpathyDispatcher to create the PMUC channel
authorDanielle Madeley <danielle.madeley@collabora.co.uk>
Mon, 14 Dec 2009 03:48:08 +0000 (14:48 +1100)
committerDanielle Madeley <danielle.madeley@collabora.co.uk>
Mon, 21 Dec 2009 09:55:02 +0000 (20:55 +1100)
src/empathy-chat-window.c

index bdc1a01960465e980a874c80ced337678bd711bd..26829a3bb375c708b46c84f8f3778c2899896766 100644 (file)
@@ -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