diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2009-06-09 17:52:07 +0800 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2009-06-09 17:53:50 +0800 |
commit | f0ff888b79ce3c902f4f7211bbe1dadcba0c1799 (patch) | |
tree | a1266f9489f2af60c90d8adced4911a77c6edd2e /libempathy | |
parent | 3ace031c4d31c397d89ddb8ae37c8898d7bd5a37 (diff) | |
download | gsoc2013-empathy-f0ff888b79ce3c902f4f7211bbe1dadcba0c1799.tar gsoc2013-empathy-f0ff888b79ce3c902f4f7211bbe1dadcba0c1799.tar.gz gsoc2013-empathy-f0ff888b79ce3c902f4f7211bbe1dadcba0c1799.tar.bz2 gsoc2013-empathy-f0ff888b79ce3c902f4f7211bbe1dadcba0c1799.tar.lz gsoc2013-empathy-f0ff888b79ce3c902f4f7211bbe1dadcba0c1799.tar.xz gsoc2013-empathy-f0ff888b79ce3c902f4f7211bbe1dadcba0c1799.tar.zst gsoc2013-empathy-f0ff888b79ce3c902f4f7211bbe1dadcba0c1799.zip |
Extract removing chatroom links to a function
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-chatroom-manager.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/libempathy/empathy-chatroom-manager.c b/libempathy/empathy-chatroom-manager.c index 016a495a2..ad1f8c611 100644 --- a/libempathy/empathy-chatroom-manager.c +++ b/libempathy/empathy-chatroom-manager.c @@ -506,6 +506,27 @@ empathy_chatroom_manager_add (EmpathyChatroomManager *manager, return FALSE; } +static void +chatroom_manager_remove_link (EmpathyChatroomManager *manager, + GList *l) +{ + EmpathyChatroomManagerPriv *priv; + EmpathyChatroom *chatroom; + + priv = GET_PRIV (manager); + + chatroom = l->data; + + if (empathy_chatroom_is_favorite (chatroom)) + reset_save_timeout (manager); + + g_signal_emit (manager, signals[CHATROOM_REMOVED], 0, chatroom); + g_signal_handlers_disconnect_by_func (chatroom, chatroom_changed_cb, manager); + + priv->chatrooms = g_list_delete_link (priv->chatrooms, l); + g_object_unref (chatroom); +} + void empathy_chatroom_manager_remove (EmpathyChatroomManager *manager, EmpathyChatroom *chatroom) @@ -527,15 +548,7 @@ empathy_chatroom_manager_remove (EmpathyChatroomManager *manager, if (this_chatroom == chatroom || empathy_chatroom_equal (chatroom, this_chatroom)) { - priv->chatrooms = g_list_delete_link (priv->chatrooms, l); - if (empathy_chatroom_is_favorite (this_chatroom)) - reset_save_timeout (manager); - - g_signal_emit (manager, signals[CHATROOM_REMOVED], 0, this_chatroom); - g_signal_handlers_disconnect_by_func (this_chatroom, chatroom_changed_cb, - manager); - - g_object_unref (this_chatroom); + chatroom_manager_remove_link (manager, l); break; } } |