]> git.0d.be Git - empathy.git/commitdiff
Grouping all 1-to-1 chats in one window and MUC's in another one. (Fixes #588812)
authorAbner Silva <abner.silva@collabora.co.uk>
Thu, 16 Jul 2009 19:55:31 +0000 (16:55 -0300)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 7 Dec 2009 16:59:34 +0000 (16:59 +0000)
src/empathy-chat-window.c
src/empathy-chat-window.h

index ea63f29aab210f873b7ef82da8cca04b6feff666..6db60b9e17fcf5f1811811dd2dbf7adae5a69fa0 100644 (file)
@@ -1848,7 +1848,7 @@ empathy_chat_window_new (void)
  * be added.
  */
 EmpathyChatWindow *
-empathy_chat_window_get_default (void)
+empathy_chat_window_get_default (gboolean room_filter)
 {
        GList    *l;
        gboolean  separate_windows = TRUE;
@@ -1863,13 +1863,16 @@ empathy_chat_window_get_default (void)
        }
 
        for (l = chat_windows; l; l = l->next) {
+               EmpathyChatWindowPriv *priv;
                EmpathyChatWindow *chat_window;
                GtkWidget         *dialog;
 
                chat_window = l->data;
+               priv = GET_PRIV (chat_window);
 
                dialog = empathy_chat_window_get_dialog (chat_window);
-               if (empathy_window_get_is_visible (GTK_WINDOW (dialog))) {
+               if (empathy_window_get_is_visible (GTK_WINDOW (dialog)) &&
+                               empathy_chat_is_room (priv->current_chat) == room_filter) {
                        /* Found a visible window on this desktop */
                        return chat_window;
                }
@@ -2086,7 +2089,7 @@ empathy_chat_window_present_chat (EmpathyChat *chat)
 
        /* If the chat has no window, create one */
        if (window == NULL) {
-               window = empathy_chat_window_get_default ();
+               window = empathy_chat_window_get_default (empathy_chat_is_room (chat));
                if (!window) {
                        window = empathy_chat_window_new ();
                }
index 1e4a001e5082084efeb339fd80481d7f85ae81dc..4f1920a9c2c6b927300f156de1ae27e2fbae4339 100644 (file)
@@ -57,7 +57,7 @@ struct _EmpathyChatWindowClass {
 };
 
 GType              empathy_chat_window_get_type       (void);
-EmpathyChatWindow *empathy_chat_window_get_default    (void);
+EmpathyChatWindow *empathy_chat_window_get_default    (gboolean room_filter);
 EmpathyChatWindow *empathy_chat_window_new            (void);
 GtkWidget *        empathy_chat_window_get_dialog     (EmpathyChatWindow *window);
 void               empathy_chat_window_add_chat       (EmpathyChatWindow *window,