aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-chatroom-manager.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-07-05 16:58:55 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-07-05 16:58:55 +0800
commitb07f3a5c948066219cb57bb113a48d0981106f23 (patch)
treeaf507014db8e7d565fe812d938f862f854a86a35 /libempathy/empathy-chatroom-manager.c
parentd88eaef098d3afc329266f25ce194c6dfebbc979 (diff)
downloadgsoc2013-empathy-b07f3a5c948066219cb57bb113a48d0981106f23.tar
gsoc2013-empathy-b07f3a5c948066219cb57bb113a48d0981106f23.tar.gz
gsoc2013-empathy-b07f3a5c948066219cb57bb113a48d0981106f23.tar.bz2
gsoc2013-empathy-b07f3a5c948066219cb57bb113a48d0981106f23.tar.lz
gsoc2013-empathy-b07f3a5c948066219cb57bb113a48d0981106f23.tar.xz
gsoc2013-empathy-b07f3a5c948066219cb57bb113a48d0981106f23.tar.zst
gsoc2013-empathy-b07f3a5c948066219cb57bb113a48d0981106f23.zip
Inform the chatroom mgr when we are handling a new room
It can't rely on the internal dispatcher any more.
Diffstat (limited to 'libempathy/empathy-chatroom-manager.c')
-rw-r--r--libempathy/empathy-chatroom-manager.c45
1 files changed, 8 insertions, 37 deletions
diff --git a/libempathy/empathy-chatroom-manager.c b/libempathy/empathy-chatroom-manager.c
index be91657b2..115e4158c 100644
--- a/libempathy/empathy-chatroom-manager.c
+++ b/libempathy/empathy-chatroom-manager.c
@@ -754,46 +754,25 @@ chatroom_manager_chat_destroyed_cb (EmpathyTpChat *chat,
}
}
-static void
-chatroom_manager_observe_channel_cb (EmpathyDispatcher *dispatcher,
- EmpathyDispatchOperation *operation, gpointer manager)
+/* Called by EmpathyChatManager when we are handling a new group chat */
+void
+empathy_chatroom_manager_chat_handled (EmpathyChatroomManager *self,
+ EmpathyTpChat *chat,
+ TpAccount *account)
{
EmpathyChatroom *chatroom;
- TpChannel *channel;
- EmpathyTpChat *chat;
const gchar *roomname;
- GQuark channel_type;
- TpHandleType handle_type;
- TpAccount *account;
- TpConnection *connection;
-
- channel_type = empathy_dispatch_operation_get_channel_type_id (operation);
-
- /* Observe Text channels to rooms only */
- if (channel_type != TP_IFACE_QUARK_CHANNEL_TYPE_TEXT)
- return;
-
- channel = empathy_dispatch_operation_get_channel (operation);
- tp_channel_get_handle (channel, &handle_type);
-
- if (handle_type != TP_HANDLE_TYPE_ROOM)
- return;
-
- chat = EMPATHY_TP_CHAT (
- empathy_dispatch_operation_get_channel_wrapper (operation));
- connection = empathy_tp_chat_get_connection (chat);
- account = empathy_get_account_for_connection (connection);
roomname = empathy_tp_chat_get_id (chat);
- chatroom = empathy_chatroom_manager_find (manager, account, roomname);
+ chatroom = empathy_chatroom_manager_find (self, account, roomname);
if (chatroom == NULL)
{
chatroom = empathy_chatroom_new_full (account, roomname, roomname,
FALSE);
empathy_chatroom_set_tp_chat (chatroom, chat);
- empathy_chatroom_manager_add (manager, chatroom);
+ empathy_chatroom_manager_add (self, chatroom);
g_object_unref (chatroom);
}
else
@@ -805,13 +784,5 @@ chatroom_manager_observe_channel_cb (EmpathyDispatcher *dispatcher,
* has been invalidated in the dispatcher.. */
g_signal_connect (chat, "destroy",
G_CALLBACK (chatroom_manager_chat_destroyed_cb),
- manager);
-}
-
-void
-empathy_chatroom_manager_observe (EmpathyChatroomManager *manager,
- EmpathyDispatcher *dispatcher)
-{
- g_signal_connect (dispatcher, "observe",
- G_CALLBACK (chatroom_manager_observe_channel_cb), manager);
+ self);
}