diff options
author | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2007-05-21 06:34:10 +0800 |
---|---|---|
committer | xclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4> | 2007-05-21 06:34:10 +0800 |
commit | 3920a4b9410ed30c5bb46f62c3bf9919d6bb0fa5 (patch) | |
tree | 1c071ef8c6bbbd3922dc5d70888bd30074313d1c /src | |
parent | a462652a29214278e1076c0aa74f6f16e3cf4ca1 (diff) | |
download | gsoc2013-empathy-3920a4b9410ed30c5bb46f62c3bf9919d6bb0fa5.tar gsoc2013-empathy-3920a4b9410ed30c5bb46f62c3bf9919d6bb0fa5.tar.gz gsoc2013-empathy-3920a4b9410ed30c5bb46f62c3bf9919d6bb0fa5.tar.bz2 gsoc2013-empathy-3920a4b9410ed30c5bb46f62c3bf9919d6bb0fa5.tar.lz gsoc2013-empathy-3920a4b9410ed30c5bb46f62c3bf9919d6bb0fa5.tar.xz gsoc2013-empathy-3920a4b9410ed30c5bb46f62c3bf9919d6bb0fa5.tar.zst gsoc2013-empathy-3920a4b9410ed30c5bb46f62c3bf9919d6bb0fa5.zip |
2007-05-21 Xavier Claessens <xclaesse@gmail.com>
* libempathy-gtk/gossip-group-chat.c:
* libempathy-gtk/gossip-group-chat.h:
* libempathy-gtk/gossip-private-chat.c:
* libempathy-gtk/gossip-private-chat.h:
* libempathy-gtk/gossip-group-chat.glade:
* libempathy-gtk/Makefile.am:
* src/empathy-chat-main.c:
* libempathy/empathy-tp-contact-list.c:
* libempathy/gossip-telepathy-group.c:
* libempathy/gossip-telepathy-group.h:
* libempathy/empathy-tp-chatroom.c:
* libempathy/empathy-tp-chatroom.h: Implementing basic chatroom support.
Actually it works only if we get invited in a chatroom.
git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@87 4ee84921-47dd-4033-b63a-18d7a039a3e4
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-chat-main.c | 60 |
1 files changed, 20 insertions, 40 deletions
diff --git a/src/empathy-chat-main.c b/src/empathy-chat-main.c index 339c4d0fa..31918d32f 100644 --- a/src/empathy-chat-main.c +++ b/src/empathy-chat-main.c @@ -39,11 +39,10 @@ #include <libempathy/gossip-debug.h> #include <libempathy/gossip-utils.h> #include <libempathy/empathy-chandler.h> -#include <libempathy/empathy-contact-manager.h> -#include <libempathy/empathy-contact-list.h> #include <libempathy/empathy-tp-chat.h> #include <libempathy/gossip-paths.h> #include <libempathy-gtk/gossip-private-chat.h> +#include <libempathy-gtk/gossip-group-chat.h> #define DEBUG_DOMAIN "ChatMain" @@ -115,8 +114,11 @@ new_channel_cb (EmpathyChandler *chandler, mc = gossip_mission_control_new (); account = mission_control_get_account_for_connection (mc, tp_conn, NULL); id = empathy_tp_chat_build_id (account, tp_chan); - chat = gossip_chat_window_find_chat_by_id (id); + + g_free (id); + g_object_unref (mc); + if (chat) { /* The chat already exists */ if (!gossip_chat_is_connected (chat)) { @@ -128,54 +130,32 @@ new_channel_cb (EmpathyChandler *chandler, g_object_unref (tp_chat); } gossip_chat_present (chat); + + g_object_unref (account); + return; } - else if (tp_chan->handle_type == TP_HANDLE_TYPE_CONTACT) { - EmpathyContactManager *manager; - EmpathyTpContactList *list; - GossipContact *contact; - GossipPrivateChat *chat; + if (tp_chan->handle_type == TP_HANDLE_TYPE_CONTACT) { /* We have a new private chat channel */ - manager = empathy_contact_manager_new (); - list = empathy_contact_manager_get_list (manager, account); - contact = empathy_tp_contact_list_get_from_handle (list, tp_chan->handle); - - chat = gossip_private_chat_new_with_channel (contact, tp_chan); - g_object_weak_ref (G_OBJECT (chat), - (GWeakNotify) chat_finalized_cb, - NULL); - - exit_timeout_stop (); - chat_count++; - - gossip_chat_present (GOSSIP_CHAT (chat)); - - g_object_unref (contact); - g_object_unref (chat); - g_object_unref (manager); + chat = GOSSIP_CHAT (gossip_private_chat_new (account, tp_chan)); } else if (tp_chan->handle_type == TP_HANDLE_TYPE_ROOM) { -#if 0 - GossipGroupChat *chat; - /* We have a new group chat channel */ - chat = gossip_group_chat_new (account, tp_chan); - g_object_weak_ref (G_OBJECT (chat), - (GWeakNotify) chat_finalized_cb, - NULL); + chat = GOSSIP_CHAT (gossip_group_chat_new (account, tp_chan)); + } - exit_timeout_stop (); - chat_count++; + g_object_weak_ref (G_OBJECT (chat), + (GWeakNotify) chat_finalized_cb, + NULL); - gossip_chat_present (GOSSIP_CHAT (chat)); + exit_timeout_stop (); + chat_count++; - g_object_unref (chat); -#endif - } + gossip_chat_present (GOSSIP_CHAT (chat)); - g_free (id); + g_object_unref (chat); g_object_unref (account); - g_object_unref (mc); + } int |