diff options
author | Abner Silva <abner.silva@collabora.co.uk> | 2009-06-30 06:18:50 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-07-01 21:37:51 +0800 |
commit | ccdfb6e4e03b3e651c68f4ed3fff61cd9db6a753 (patch) | |
tree | 1e71e275a958a3770a6acd554b81ab917847ec71 /src/empathy-chat-window.c | |
parent | 8caba0f8e3f7d48881572d456ef4f92a4637c272 (diff) | |
download | gsoc2013-empathy-ccdfb6e4e03b3e651c68f4ed3fff61cd9db6a753.tar gsoc2013-empathy-ccdfb6e4e03b3e651c68f4ed3fff61cd9db6a753.tar.gz gsoc2013-empathy-ccdfb6e4e03b3e651c68f4ed3fff61cd9db6a753.tar.bz2 gsoc2013-empathy-ccdfb6e4e03b3e651c68f4ed3fff61cd9db6a753.tar.lz gsoc2013-empathy-ccdfb6e4e03b3e651c68f4ed3fff61cd9db6a753.tar.xz gsoc2013-empathy-ccdfb6e4e03b3e651c68f4ed3fff61cd9db6a753.tar.zst gsoc2013-empathy-ccdfb6e4e03b3e651c68f4ed3fff61cd9db6a753.zip |
New chatrooms are no longer marked as favorite by default. Fixes bug #575667
Diffstat (limited to 'src/empathy-chat-window.c')
-rw-r--r-- | src/empathy-chat-window.c | 18 |
1 files changed, 9 insertions, 9 deletions
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 |