From ccdfb6e4e03b3e651c68f4ed3fff61cd9db6a753 Mon Sep 17 00:00:00 2001 From: Abner Silva Date: Mon, 29 Jun 2009 19:18:50 -0300 Subject: New chatrooms are no longer marked as favorite by default. Fixes bug #575667 --- src/empathy-chat-window.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/empathy-chat-window.c') diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index f4315f5fa..f9d0b924a 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -557,12 +557,15 @@ chat_window_conv_activate_cb (GtkAction *action, if (is_room) { const gchar *room; EmpathyAccount *account; - gboolean found; + gboolean found = FALSE; + EmpathyChatroom *chatroom; room = empathy_chat_get_id (priv->current_chat); account = empathy_chat_get_account (priv->current_chat); - found = empathy_chatroom_manager_find (priv->chatroom_manager, - account, room) != NULL; + chatroom = empathy_chatroom_manager_find (priv->chatroom_manager, + account, room); + if (chatroom != NULL) + found = empathy_chatroom_is_favorite (chatroom); DEBUG ("This room %s favorite", found ? "is" : "is not"); gtk_toggle_action_set_active ( @@ -613,19 +616,16 @@ chat_window_favorite_toggled_cb (GtkToggleAction *toggle_action, chatroom = empathy_chatroom_manager_find (priv->chatroom_manager, account, room); - if (active && !chatroom) { + if (chatroom == NULL) { const gchar *name; name = empathy_chat_get_name (priv->current_chat); chatroom = empathy_chatroom_new_full (account, room, name, FALSE); empathy_chatroom_manager_add (priv->chatroom_manager, chatroom); g_object_unref (chatroom); - return; - } + } - if (!active && chatroom) { - empathy_chatroom_manager_remove (priv->chatroom_manager, chatroom); - } + empathy_chatroom_set_favorite (chatroom, active); } static void -- cgit v1.2.3