[empathy] Grouping all 1-to-1 chats in one window and MUC's in another one. (Fixes #588812)



commit 487f4d0fc504b9c0cb77a030869893054c907d6d
Author: Abner Silva <abner silva collabora co uk>
Date:   Thu Jul 16 16:55:31 2009 -0300

    Grouping all 1-to-1 chats in one window and MUC's in another one. (Fixes #588812)

 src/empathy-chat-window.c |    9 ++++++---
 src/empathy-chat-window.h |    2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index ea63f29..6db60b9 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -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 ();
 		}
diff --git a/src/empathy-chat-window.h b/src/empathy-chat-window.h
index 1e4a001..4f1920a 100644
--- a/src/empathy-chat-window.h
+++ b/src/empathy-chat-window.h
@@ -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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]