* ModestTnyStoreAction doesn't have to be a GObject, because it's stateless
[modest] / src / modest-tny-store-actions.c
1 /* modest-tny-store-actions.c */
2
3 /* insert (c)/licensing information) */
4
5 #include <tny-msg.h>
6 #include <tny-msg-iface.h>                      
7 #include <tny-msg-header.h>
8 #include <tny-msg-header-iface.h>
9 #include <tny-account-iface.h>  
10 #include <tny-account-store-iface.h>
11 #include <tny-store-account-iface.h>    
12 #include <tny-store-account.h>
13 #include <tny-stream-camel.h>
14 #include <string.h>
15 #include <camel/camel-folder.h>
16 #include <camel/camel.h>
17 #include <camel/camel-folder-summary.h>
18
19
20 #include <glib.h>
21 #include "modest-tny-store-actions.h"
22
23
24 void
25 modest_tny_store_actions_update_folders (TnyStoreAccountIface *storage_account)
26 {
27
28         const TnyListIface* folders;
29         TnyIteratorIface* ifolders;
30         const TnyMsgFolderIface *cur_folder;
31
32         folders = tny_store_account_iface_get_folders (storage_account, 
33                                                        TNY_STORE_ACCOUNT_FOLDER_TYPE_SUBSCRIBED);
34         
35         ifolders = tny_list_iface_create_iterator (folders);
36         
37         for (cur_folder = TNY_MSG_FOLDER_IFACE(tny_iterator_iface_first (ifolders)); 
38              tny_iterator_iface_has_next (ifolders); 
39              tny_iterator_iface_next (ifolders)) {
40                 
41                 cur_folder = TNY_MSG_FOLDER_IFACE(tny_iterator_iface_current (ifolders));
42                 tny_msg_folder_iface_refresh (cur_folder);
43         }
44         
45         g_object_unref (ifolders);
46 }
47