aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-12-03 23:12:05 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-12-03 23:12:05 +0800
commitde24c820d141079b880de18e3ff6c28955588732 (patch)
treee74bf299ff2fde4a7fce370a2714b90b4b9389cd /src
parent1fe7346f60e911fa37a22361c34efc6baa946bf8 (diff)
downloadgsoc2013-empathy-de24c820d141079b880de18e3ff6c28955588732.tar
gsoc2013-empathy-de24c820d141079b880de18e3ff6c28955588732.tar.gz
gsoc2013-empathy-de24c820d141079b880de18e3ff6c28955588732.tar.bz2
gsoc2013-empathy-de24c820d141079b880de18e3ff6c28955588732.tar.lz
gsoc2013-empathy-de24c820d141079b880de18e3ff6c28955588732.tar.xz
gsoc2013-empathy-de24c820d141079b880de18e3ff6c28955588732.tar.zst
gsoc2013-empathy-de24c820d141079b880de18e3ff6c28955588732.zip
Cleanup chat objects API and request a new Text channel if account gets
2007-12-03 Xavier Claessens <xclaesse@gmail.com> * libempathy-gtk/empathy-chat-window.c: * libempathy-gtk/empathy-chat.c: * libempathy-gtk/empathy-chat.h: * libempathy-gtk/empathy-group-chat.c: * libempathy-gtk/empathy-group-chat.h: * libempathy-gtk/empathy-private-chat.c: * libempathy-gtk/empathy-private-chat.h: * libempathy/empathy-tp-chat.c: * libempathy/empathy-tp-chat.h: * python/pyempathy/pyempathy.defs: * python/pyempathygtk/pyempathygtk.defs: * src/empathy-chat-chandler.c: Cleanup chat objects API and request a new Text channel if account gets reconnected. svn path=/trunk/; revision=461
Diffstat (limited to 'src')
-rw-r--r--src/empathy-chat-chandler.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/empathy-chat-chandler.c b/src/empathy-chat-chandler.c
index 2064f16d6..dc2eb60f7 100644
--- a/src/empathy-chat-chandler.c
+++ b/src/empathy-chat-chandler.c
@@ -54,9 +54,10 @@ chat_chandler_new_channel_cb (EmpathyChandler *chandler,
TpChan *tp_chan,
MissionControl *mc)
{
- McAccount *account;
- EmpathyChat *chat;
- gchar *id;
+ EmpathyTpChat *tp_chat;
+ McAccount *account;
+ EmpathyChat *chat;
+ gchar *id;
account = mission_control_get_account_for_connection (mc, tp_conn, NULL);
id = empathy_inspect_channel (account, tp_chan);
@@ -66,8 +67,6 @@ chat_chandler_new_channel_cb (EmpathyChandler *chandler,
if (chat) {
/* The chat already exists */
if (!empathy_chat_is_connected (chat)) {
- EmpathyTpChat *tp_chat;
-
/* The chat died, give him the new text channel */
if (empathy_chat_is_group_chat (chat)) {
tp_chat = EMPATHY_TP_CHAT (empathy_tp_chatroom_new (account, tp_chan));
@@ -85,17 +84,26 @@ chat_chandler_new_channel_cb (EmpathyChandler *chandler,
if (tp_chan->handle_type == TP_HANDLE_TYPE_CONTACT) {
/* We have a new private chat channel */
- chat = EMPATHY_CHAT (empathy_private_chat_new (account, tp_chan));
+ tp_chat = empathy_tp_chat_new (account, tp_chan);
+ chat = EMPATHY_CHAT (empathy_private_chat_new (tp_chat));
}
else if (tp_chan->handle_type == TP_HANDLE_TYPE_ROOM) {
/* We have a new group chat channel */
- chat = EMPATHY_CHAT (empathy_group_chat_new (account, tp_chan));
+ tp_chat = EMPATHY_TP_CHAT (empathy_tp_chatroom_new (account, tp_chan));
+ chat = EMPATHY_CHAT (empathy_group_chat_new (EMPATHY_TP_CHATROOM (tp_chat)));
+ } else {
+ empathy_debug (DEBUG_DOMAIN,
+ "Unknown handle type (%d) for Text channel",
+ tp_chan->handle_type);
+ g_object_unref (account);
+ return;
}
- empathy_chat_present (EMPATHY_CHAT (chat));
+ empathy_chat_present (chat);
g_object_unref (chat);
g_object_unref (account);
+ g_object_unref (tp_chat);
}
int