diff options
author | Not Zed <NotZed@Ximian.com> | 2004-03-11 11:04:45 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-03-11 11:04:45 +0800 |
commit | 6071a963e85f69133cc1761e37b6ed942629d70d (patch) | |
tree | 95c9e1644c80d083e2baf049e66b9f99c5997051 /camel/providers/imapp | |
parent | ecda7da11e893ff29258388c7b594b5ef4fa902a (diff) | |
download | gsoc2013-evolution-6071a963e85f69133cc1761e37b6ed942629d70d.tar.gz gsoc2013-evolution-6071a963e85f69133cc1761e37b6ed942629d70d.tar.zst gsoc2013-evolution-6071a963e85f69133cc1761e37b6ed942629d70d.zip |
turn off NOINFERIORS always, translate to nochildren.
2004-03-11 Not Zed <NotZed@Ximian.com>
* providers/imap/camel-imap-store.c (get_one_folder_offline):
(parse_list_response_as_folder_info): turn
off NOINFERIORS always, translate to nochildren.
2004-03-08 Not Zed <NotZed@Ximian.com>
* camel-vee-store.c (vee_get_folder_info): setup virtual/system
flags as appropriate.
(change_folder): setup flags properly.
* providers/nntp/camel-nntp-store.c
(nntp_store_get_subscribed_folder_info): mark all folders as
system folders.
* providers/local/camel-mh-store.c (fill_fi): add this to setup
folderinfo.
(folder_info_new): call fill_fi to fill unread/total.
(recursive_scan, folders_scan): ahh yeah, so wtf was i thinking,
store->flags != get_folder_info flags!!!!
* providers/local/camel-maildir-store.c (camel_folder_info_new):
remove unread count arg & setup total.
(fill_fi): setup total field.
(scan_dir): remove the code that checked the directory directly -
use fill_fi instead. It will more accurately reflect what you get
when you visit the folder.
(camel_folder_info_new): mark "." as a system folder.
(scan_dir): try to setup children/no children flags properly.
* providers/local/camel-mbox-store.c (fill_fi): setup total field.
(scan_dir): init total.
(get_folder_info): "
2004-03-05 Not Zed <NotZed@Ximian.com>
* providers/imap/camel-imap-store.c
(parse_list_response_as_folder_info): mark INBOX as a system
folder. Can't be renamed/deleted.
(fill_fi): setup total field.
(get_folder_counts): ditto.
* camel-store.c (add_special_info): set the system folder flag.
* camel-store.h: time to fix up the camelfolderinfo mess. fix
some member names, and add some type fields. Fixed all uses.
svn path=/trunk/; revision=25019
Diffstat (limited to 'camel/providers/imapp')
-rw-r--r-- | camel/providers/imapp/camel-imapp-driver.c | 49 | ||||
-rw-r--r-- | camel/providers/imapp/camel-imapp-driver.h | 19 | ||||
-rw-r--r-- | camel/providers/imapp/camel-imapp-store.c | 14 |
3 files changed, 58 insertions, 24 deletions
diff --git a/camel/providers/imapp/camel-imapp-driver.c b/camel/providers/imapp/camel-imapp-driver.c index 0e666c46bd..54c050c675 100644 --- a/camel/providers/imapp/camel-imapp-driver.c +++ b/camel/providers/imapp/camel-imapp-driver.c @@ -430,24 +430,37 @@ camel_imapp_driver_sync(CamelIMAPPDriver *id, gboolean expunge, CamelIMAPPFolder } } -struct _fetch_data { - struct _fetch_data *next; - struct _fetch_data *prev; +static void +fetch_data_free(CamelIMAPPFetch *fd) +{ + if (fd->body) + camel_object_unref(fd->body); + camel_object_unref(fd->folder); + g_free(fd->uid); + g_free(fd->section); + g_free(fd); +} - CamelStream *data; - const char *uid; - const char *section; -}; +struct _CamelStream * camel_imapp_driver_fetch(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder, const char *uid, const char *body) +{ + return NULL; +} -CamelStream * -camel_imapp_driver_fetch(CamelIMAPPDriver *id, CamelIMAPPFolder *folder, const char *uid, const char *section) +#if 0 +void +camel_imapp_driver_fetch(CamelIMAPPDriver *id, CamelIMAPPFolder *folder, const char *uid, const char *section, CamelIMAPPFetchFunc done, void *data) { - struct _fetch_data fd; + struct _fetch_data *fd; CamelIMAPPCommand *ic; - fd.data = NULL; - fd.uid = uid; - fd.section = section; + fd = g_malloc0(sizeof(*fd)); + fd->folder = folder; + camel_object_ref(folder); + fd->uid = g_strdup(uid); + fd->section = g_strdup(fd->section); + fd->done = done; + fd->data = data; + e_dlist_addtail(&id->body_fetch, (EDListNode *)&fd); CAMEL_TRY { @@ -467,6 +480,7 @@ camel_imapp_driver_fetch(CamelIMAPPDriver *id, CamelIMAPPFolder *folder, const c return fd.data; } +#endif GPtrArray * camel_imapp_driver_list(CamelIMAPPDriver *id, const char *name, guint32 flags) @@ -738,16 +752,13 @@ driver_resp_fetch(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata) } if ((finfo->got & (FETCH_BODY|FETCH_UID)) == (FETCH_BODY|FETCH_UID)) { - struct _fetch_data *fd, *fn; + CamelIMAPPFetch *fd, *fn; - fd = (struct _fetch_data *)sdata->body_fetch.head; + fd = (CamelIMAPPFetch *)sdata->body_fetch.head; fn = fd->next; while (fn) { if (!strcmp(finfo->uid, fd->uid) && !strcmp(finfo->section, fd->section)) { - if (fd->data) - camel_object_unref(fd->data); - fd->data = finfo->body; - camel_object_ref(fd->data); + fd->done(sdata, fd); e_dlist_remove((EDListNode *)fd); e_dlist_addtail(&sdata->body_fetch_done, (EDListNode *)fd); break; diff --git a/camel/providers/imapp/camel-imapp-driver.h b/camel/providers/imapp/camel-imapp-driver.h index 3124700619..c336dd3d2a 100644 --- a/camel/providers/imapp/camel-imapp-driver.h +++ b/camel/providers/imapp/camel-imapp-driver.h @@ -14,10 +14,28 @@ typedef struct _CamelIMAPPDriver CamelIMAPPDriver; typedef struct _CamelIMAPPDriverClass CamelIMAPPDriverClass; +typedef struct _CamelIMAPPFetch CamelIMAPPFetch; + typedef int (*CamelIMAPPDriverFunc)(struct _CamelIMAPPDriver *driver, void *data); typedef struct _CamelSasl * (*CamelIMAPPSASLFunc)(struct _CamelIMAPPDriver *driver, void *data); typedef void (*CamelIMAPPLoginFunc)(struct _CamelIMAPPDriver *driver, char **login, char **pass, void *data); +typedef void (*CamelIMAPPFetchFunc)(struct _CamelIMAPPDriver *driver, CamelIMAPPFetch *); + +struct _CamelIMAPPFetch { + struct _CamelIMAPPFetch *next; + struct _CamelIMAPPFetch *prev; + + CamelStream *body; /* the content fetched */ + + struct _CamelIMAPPFolder *folder; + char *uid; + char *section; + + CamelIMAPPFetchFunc done; + void *data; +}; + struct _CamelMimeMessage; struct _CamelIMAPPDriver { @@ -73,6 +91,7 @@ void camel_imapp_driver_update(CamelIMAPPDriver *id, struct _CamelIMAPPFolder void camel_imapp_driver_sync(CamelIMAPPDriver *id, gboolean expunge, struct _CamelIMAPPFolder *folder); struct _CamelStream * camel_imapp_driver_fetch(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder, const char *uid, const char *body); + GPtrArray * camel_imapp_driver_list(CamelIMAPPDriver *id, const char *name, guint32 flags); struct _CamelStream *camel_imapp_driver_get(CamelIMAPPDriver *id, struct _CamelIMAPPFolder *folder, const char *uid); diff --git a/camel/providers/imapp/camel-imapp-store.c b/camel/providers/imapp/camel-imapp-store.c index 50c5c4db8b..2332a09648 100644 --- a/camel/providers/imapp/camel-imapp-store.c +++ b/camel/providers/imapp/camel-imapp-store.c @@ -540,13 +540,17 @@ folders_build_info(CamelURL *base, struct _list_info *li) camel_url_set_path(base, path); fi = g_malloc0(sizeof(*fi)); - fi->url = camel_url_to_string(base, CAMEL_URL_HIDE_ALL); + fi->uri = camel_url_to_string(base, CAMEL_URL_HIDE_ALL); fi->name = g_strdup(name); fi->full_name = full_name; fi->path = g_strdup(path); - fi->unread_message_count = -1; + fi->unread = -1; + fi->total = -1; fi->flags = li->flags; + if (!g_ascii_strcasecmp(fi->full_name, "inbox")) + fi->flags |= CAMEL_FOLDER_SYSTEM; + /* TODO: could look up count here ... */ /* ?? */ /*folder = camel_object_bag_get(store->folders, "INBOX");*/ @@ -616,7 +620,7 @@ folders_build_rec(CamelURL *base, GPtrArray *folders, int *ip, CamelFolderInfo * fi = folders_build_info(base, li); fi->parent = pfi; if (last != NULL) - last->sibling = fi; + last->next = fi; last = fi; if (first == NULL) first = fi; @@ -638,10 +642,10 @@ folder_info_dump(CamelFolderInfo *fi, int depth) memset(s, ' ', depth); s[depth] = 0; while (fi) { - printf("%s%s (%s)\n", s, fi->name, fi->url); + printf("%s%s (%s)\n", s, fi->name, fi->uri); if (fi->child) folder_info_dump(fi->child, depth+2); - fi = fi->sibling; + fi = fi->next; } } |