- /* Add our extra folders only if it passes the query */
- GSList *iter = priv->list_extra_folders;
- while (iter) {
- TnyFolder *folder = TNY_FOLDER (iter->data);
-
- if (folder && modest_tny_local_folders_account_query_passes (query, folder))
- tny_list_prepend (list, G_OBJECT (folder));
-
- iter = g_slist_next (iter);
- }
-}
-
-static void
-add_account_folders_to_merged_folder (TnyAccount *account, TnyMergeFolder* merge_folder)
-{
- const gchar* account_id = tny_account_get_id (account);
- const gboolean is_actual_local_folders_account = account_id &&
- (strcmp (account_id, MODEST_LOCAL_FOLDERS_ACCOUNT_ID) == 0);
-
- TnyList *list_outbox_folders = tny_simple_list_new ();
- tny_folder_store_get_folders (TNY_FOLDER_STORE (account),
- list_outbox_folders, NULL, NULL);
-
- TnyIterator* iter = tny_list_create_iterator (list_outbox_folders);
- while (!tny_iterator_is_done (iter))
- {
- TnyFolder *folder = TNY_FOLDER (tny_iterator_get_current (iter));
-
- if (folder) {
- gboolean add = TRUE;
- /* TODO: Do not add outboxes that are inside local-folders/,
- * because these are just left-over from earlier Modest versions
- * that put the outbox there: */
- if (is_actual_local_folders_account) {
- const TnyFolderType type = modest_tny_folder_get_local_folder_type (folder);
- if (type == TNY_FOLDER_TYPE_OUTBOX) {
- add = FALSE;
- }
- }
-
- if (add)
- tny_merge_folder_add_folder (merge_folder, folder);
-
- g_object_unref (folder);
- }