aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/gossip-new-chatroom-dialog.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-05-31 21:23:57 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-05-31 21:23:57 +0800
commitb103cb3c5a332d6136c3e040e61b5e8b37614b1a (patch)
treee4b38eec8c40dcb70a59afbb267693eecad153d5 /libempathy-gtk/gossip-new-chatroom-dialog.c
parentc06a2a5a2bb1a923918de34fe63efe18c090902b (diff)
downloadgsoc2013-empathy-b103cb3c5a332d6136c3e040e61b5e8b37614b1a.tar
gsoc2013-empathy-b103cb3c5a332d6136c3e040e61b5e8b37614b1a.tar.gz
gsoc2013-empathy-b103cb3c5a332d6136c3e040e61b5e8b37614b1a.tar.bz2
gsoc2013-empathy-b103cb3c5a332d6136c3e040e61b5e8b37614b1a.tar.lz
gsoc2013-empathy-b103cb3c5a332d6136c3e040e61b5e8b37614b1a.tar.xz
gsoc2013-empathy-b103cb3c5a332d6136c3e040e61b5e8b37614b1a.tar.zst
gsoc2013-empathy-b103cb3c5a332d6136c3e040e61b5e8b37614b1a.zip
No need to RequestHandle, MissionControl has API to request the channel
2007-05-31 Xavier Claessens <xclaesse@gmail.com> * libempathy-gtk/gossip-new-chatroom-dialog.c: No need to RequestHandle, MissionControl has API to request the channel from handle string. * libempathy-gtk/empathy-main-window.c: Request room channel when clicking on favorite rooms. * TODO: Add a task: supporting registering. svn path=/trunk/; revision=102
Diffstat (limited to 'libempathy-gtk/gossip-new-chatroom-dialog.c')
-rw-r--r--libempathy-gtk/gossip-new-chatroom-dialog.c66
1 files changed, 9 insertions, 57 deletions
diff --git a/libempathy-gtk/gossip-new-chatroom-dialog.c b/libempathy-gtk/gossip-new-chatroom-dialog.c
index 838f90a74..81594f1d1 100644
--- a/libempathy-gtk/gossip-new-chatroom-dialog.c
+++ b/libempathy-gtk/gossip-new-chatroom-dialog.c
@@ -128,10 +128,6 @@ static void new_chatroom_dialog_model_row_deleted_cb (GtkTreeMode
static void new_chatroom_dialog_model_selection_changed (GtkTreeSelection *selection,
GossipNewChatroomDialog *dialog);
static void new_chatroom_dialog_join (GossipNewChatroomDialog *dialog);
-static void new_chatroom_dialog_request_handles_cb (DBusGProxy *proxy,
- GArray *handles,
- GError *error,
- McAccount *account);
static void new_chatroom_dialog_entry_changed_cb (GtkWidget *entry,
GossipNewChatroomDialog *dialog);
static void new_chatroom_dialog_browse_start (GossipNewChatroomDialog *dialog);
@@ -604,12 +600,10 @@ new_chatroom_dialog_join (GossipNewChatroomDialog *dialog)
McAccount *account;
GossipAccountChooser *account_chooser;
MissionControl *mc;
- TpConn *tp_conn;
GList *chatrooms, *l;
const gchar *room;
const gchar *server = NULL;
gchar *room_name = NULL;
- const gchar *room_names[2] = {NULL, NULL};
chatrooms = new_chatroom_dialog_model_get_selected (dialog);
if (chatrooms) {
@@ -626,66 +620,24 @@ new_chatroom_dialog_join (GossipNewChatroomDialog *dialog)
}
account_chooser = GOSSIP_ACCOUNT_CHOOSER (dialog->account_chooser);
account = gossip_account_chooser_get_account (account_chooser);
- mc = gossip_mission_control_new ();
- tp_conn = mission_control_get_connection (mc, account, NULL);
-
- if (!tp_conn) {
- g_object_unref (mc);
- return;
- }
if (!G_STR_EMPTY (server)) {
room_name = g_strconcat (room, "@", server, NULL);
- room_names[0] = room_name;
} else {
- room_names[0] = room;
+ room_name = g_strdup (room);
}
- gossip_debug (DEBUG_DOMAIN, "Requesting handle for room '%s'",
- room_names[0]);
-
- /* Gives the ref of account/tp_conn to the callback */
- tp_conn_request_handles_async (DBUS_G_PROXY (tp_conn),
- TP_HANDLE_TYPE_ROOM,
- room_names,
- (tp_conn_request_handles_reply)
- new_chatroom_dialog_request_handles_cb,
- account);
- g_free (room_name);
- g_object_unref (mc);
-}
-
-static void
-new_chatroom_dialog_request_handles_cb (DBusGProxy *proxy,
- GArray *handles,
- GError *error,
- McAccount *account)
-{
- MissionControl *mc;
- guint handle;
-
- if (error) {
- gossip_debug (DEBUG_DOMAIN,
- "Error requesting room handle: %s",
- error ? error->message : "No error given");
- goto OUT;
- }
+ gossip_debug (DEBUG_DOMAIN, "Requesting channel for '%s'", room_name);
mc = gossip_mission_control_new ();
- handle = g_array_index (handles, guint, 0);
-
- gossip_debug (DEBUG_DOMAIN, "Got handle %d, requesting channel", handle);
- mission_control_request_channel (mc,
- account,
- TP_IFACE_CHANNEL_TYPE_TEXT,
- handle,
- TP_HANDLE_TYPE_ROOM,
- NULL, NULL);
+ mission_control_request_channel_with_string_handle (mc,
+ account,
+ TP_IFACE_CHANNEL_TYPE_TEXT,
+ room_name,
+ TP_HANDLE_TYPE_ROOM,
+ NULL, NULL);
+ g_free (room_name);
g_object_unref (mc);
-
-OUT:
- g_object_unref (account);
- g_object_unref (proxy);
}
static void