diff options
author | Jonas Bonn <jonas@southpole.se> | 2010-03-06 00:02:53 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-05-27 22:32:35 +0800 |
commit | 2f9166bf42462e44b40462cbd9fc562f6cf507af (patch) | |
tree | 1a59bda08e163350546311ce28b3df4090fa6a16 | |
parent | 2cf16f8c3b783ac09ed638633b34dffc50279106 (diff) | |
download | gsoc2013-empathy-2f9166bf42462e44b40462cbd9fc562f6cf507af.tar gsoc2013-empathy-2f9166bf42462e44b40462cbd9fc562f6cf507af.tar.gz gsoc2013-empathy-2f9166bf42462e44b40462cbd9fc562f6cf507af.tar.bz2 gsoc2013-empathy-2f9166bf42462e44b40462cbd9fc562f6cf507af.tar.lz gsoc2013-empathy-2f9166bf42462e44b40462cbd9fc562f6cf507af.tar.xz gsoc2013-empathy-2f9166bf42462e44b40462cbd9fc562f6cf507af.tar.zst gsoc2013-empathy-2f9166bf42462e44b40462cbd9fc562f6cf507af.zip |
Use ensure_chatroom in callback
The new function ensure_chatroom should be used by favorite-toggled
callback.
-rw-r--r-- | src/empathy-chat-window.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 94717f3c8..39711e2cd 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -828,19 +828,14 @@ chat_window_favorite_toggled_cb (GtkToggleAction *toggle_action, account = empathy_chat_get_account (priv->current_chat); room = empathy_chat_get_id (priv->current_chat); - chatroom = empathy_chatroom_manager_find (priv->chatroom_manager, - account, room); - - 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); - } + chatroom = empathy_chatroom_manager_ensure_chatroom ( + priv->chatroom_manager, + account, + room, + empathy_chat_get_name (priv->current_chat)); empathy_chatroom_set_favorite (chatroom, active); + g_object_unref(chatroom); } static void |