aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-07-08 07:01:31 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-07-09 18:16:19 +0800
commitacc341d1178dc9806b32d7aadc4154259dadf63c (patch)
tree3630fb6edc715f693fbc227376f2f4acbd0cb02c /src
parent6bb5c181852365a1bb14820528bd2b925069140d (diff)
downloadgsoc2013-empathy-acc341d1178dc9806b32d7aadc4154259dadf63c.tar
gsoc2013-empathy-acc341d1178dc9806b32d7aadc4154259dadf63c.tar.gz
gsoc2013-empathy-acc341d1178dc9806b32d7aadc4154259dadf63c.tar.bz2
gsoc2013-empathy-acc341d1178dc9806b32d7aadc4154259dadf63c.tar.lz
gsoc2013-empathy-acc341d1178dc9806b32d7aadc4154259dadf63c.tar.xz
gsoc2013-empathy-acc341d1178dc9806b32d7aadc4154259dadf63c.tar.zst
gsoc2013-empathy-acc341d1178dc9806b32d7aadc4154259dadf63c.zip
tell the chatroom manager asap about chats
Diffstat (limited to 'src')
-rw-r--r--src/empathy-chat-manager.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/empathy-chat-manager.c b/src/empathy-chat-manager.c
index 0e8a335c2..3c66e36e5 100644
--- a/src/empathy-chat-manager.c
+++ b/src/empathy-chat-manager.c
@@ -95,6 +95,24 @@ chat_data_free (ChatData *data)
}
static void
+tell_chatroom_manager_if_needed (TpAccount *account,
+ EmpathyTpChat *chat)
+{
+ TpHandleType type;
+
+ tp_channel_get_handle (empathy_tp_chat_get_channel (chat), &type);
+
+ if (type == TP_HANDLE_TYPE_ROOM)
+ {
+ EmpathyChatroomManager *chatroom_mgr;
+
+ chatroom_mgr = empathy_chatroom_manager_dup_singleton (NULL);
+ empathy_chatroom_manager_chat_handled (chatroom_mgr, chat, account);
+ g_object_unref (chatroom_mgr);
+ }
+}
+
+static void
process_tp_chat (EmpathyTpChat *tp_chat,
TpAccount *account,
gint64 user_action_time)
@@ -102,6 +120,8 @@ process_tp_chat (EmpathyTpChat *tp_chat,
EmpathyChat *chat = NULL;
const gchar *id;
+ tell_chatroom_manager_if_needed (account, tp_chat);
+
id = empathy_tp_chat_get_id (tp_chat);
if (!tp_str_empty (id))
{
@@ -119,7 +139,6 @@ process_tp_chat (EmpathyTpChat *tp_chat,
* a GtkWidget. This reference will be taken by a container
* (a GtkNotebook) when we'll call empathy_chat_window_present_chat */
}
-
empathy_chat_window_present_chat (chat, user_action_time);
if (empathy_tp_chat_is_invited (tp_chat, NULL))
@@ -129,15 +148,6 @@ process_tp_chat (EmpathyTpChat *tp_chat,
empathy_tp_chat_join (tp_chat);
}
- if (empathy_chat_is_room (chat))
- {
- EmpathyChatroomManager *chatroom_mgr;
-
- chatroom_mgr = empathy_chatroom_manager_dup_singleton (NULL);
- empathy_chatroom_manager_chat_handled (chatroom_mgr, tp_chat, account);
- g_object_unref (chatroom_mgr);
- }
-
g_object_unref (tp_chat);
}