diff options
author | Not Zed <NotZed@Ximian.com> | 2004-11-12 13:53:12 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-11-12 13:53:12 +0800 |
commit | 8e212824134c1740d05fb36799f78716c5059801 (patch) | |
tree | 47fc692dba176af4fa0ccfa45d31739886162c12 /camel/providers/imapp | |
parent | 55bead18b69fd4e7ad2b09700867add2ca7e9838 (diff) | |
download | gsoc2013-evolution-8e212824134c1740d05fb36799f78716c5059801.tar gsoc2013-evolution-8e212824134c1740d05fb36799f78716c5059801.tar.gz gsoc2013-evolution-8e212824134c1740d05fb36799f78716c5059801.tar.bz2 gsoc2013-evolution-8e212824134c1740d05fb36799f78716c5059801.tar.lz gsoc2013-evolution-8e212824134c1740d05fb36799f78716c5059801.tar.xz gsoc2013-evolution-8e212824134c1740d05fb36799f78716c5059801.tar.zst gsoc2013-evolution-8e212824134c1740d05fb36799f78716c5059801.zip |
** Merge in notzed-messageinfo-branch, fix some minor conflicts.
2004-11-12 Not Zed <NotZed@Ximian.com>
** Merge in notzed-messageinfo-branch, fix some minor conflicts.
svn path=/trunk/; revision=27898
Diffstat (limited to 'camel/providers/imapp')
-rw-r--r-- | camel/providers/imapp/ChangeLog | 4 | ||||
-rw-r--r-- | camel/providers/imapp/camel-imapp-driver.c | 48 | ||||
-rw-r--r-- | camel/providers/imapp/camel-imapp-folder.c | 1 | ||||
-rw-r--r-- | camel/providers/imapp/camel-imapp-store.c | 10 | ||||
-rw-r--r-- | camel/providers/imapp/camel-imapp-store.h | 2 | ||||
-rw-r--r-- | camel/providers/imapp/camel-imapp-summary.c | 2 | ||||
-rw-r--r-- | camel/providers/imapp/camel-imapp-summary.h | 2 | ||||
-rw-r--r-- | camel/providers/imapp/camel-imapp-utils.c | 21 | ||||
-rw-r--r-- | camel/providers/imapp/camel-imapp-utils.h | 4 |
9 files changed, 50 insertions, 44 deletions
diff --git a/camel/providers/imapp/ChangeLog b/camel/providers/imapp/ChangeLog index 9c70d8d7b9..63b46ae57a 100644 --- a/camel/providers/imapp/ChangeLog +++ b/camel/providers/imapp/ChangeLog @@ -1,3 +1,7 @@ +2004-11-11 Not Zed <NotZed@Ximian.com> + + * updates for camel folder summary api changes. + 2004-09-30 Not Zed <NotZed@Ximian.com> * camel-imapp-engine.c: make the build again, warnings, doesn't diff --git a/camel/providers/imapp/camel-imapp-driver.c b/camel/providers/imapp/camel-imapp-driver.c index aa1f2a273e..c9a9e45042 100644 --- a/camel/providers/imapp/camel-imapp-driver.c +++ b/camel/providers/imapp/camel-imapp-driver.c @@ -332,7 +332,7 @@ imapp_write_flags(CamelIMAPPDriver *id, guint32 orset, gboolean on, CamelFolderS ic = camel_imapp_engine_command_new(id->engine, "STORE", NULL, "UID STORE "); flush = imapp_uidset_add(&ss, ic, camel_message_info_uid(info)); } - camel_folder_summary_info_free(summary, (CamelMessageInfo *)info); + camel_message_info_free((CamelMessageInfo *)info); } if (i == count-1 && ic != NULL) @@ -391,7 +391,7 @@ camel_imapp_driver_sync(CamelIMAPPDriver *id, gboolean expunge, CamelIMAPPFolder off_orset |= ( flags ^ sflags ) & ~flags; on_orset |= (flags ^ sflags) & flags; } - camel_folder_summary_info_free(summary, (CamelMessageInfo *)info); + camel_message_info_free((CamelMessageInfo *)info); } if (on_orset || off_orset) { @@ -407,7 +407,7 @@ camel_imapp_driver_sync(CamelIMAPPDriver *id, gboolean expunge, CamelIMAPPFolder if (info == NULL) continue; info->server_flags = info->info.flags & CAMEL_IMAPP_SERVER_FLAGS; - camel_folder_summary_info_free(summary, (CamelMessageInfo *)info); + camel_message_info_free((CamelMessageInfo *)info); } camel_folder_summary_touch(summary); /* could save summary here, incase of failure? */ @@ -656,7 +656,7 @@ driver_resp_expunge(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata) if (info) { printf("expunging msg %d\n", id); camel_folder_summary_remove(summary, info); - camel_folder_summary_info_free(summary, info); + camel_message_info_free(info); camel_folder_change_info_remove_uid(sdata->folder->changes, camel_message_info_uid(info)); } else { printf("can not find msg %u from expunge\n", id); @@ -670,7 +670,7 @@ static int driver_resp_fetch(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata) { struct _fetch_info *finfo = NULL; - CamelMessageInfo *info, *uinfo; + CamelIMAPPMessageInfo *info, *uinfo; unsigned int i; CamelFolderSummary *summary; @@ -684,36 +684,36 @@ driver_resp_fetch(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata) finfo = imap_parse_fetch(ie->stream); imap_dump_fetch(finfo); - info = camel_folder_summary_index(summary, id-1); + info = (CamelIMAPPMessageInfo *)camel_folder_summary_index(summary, id-1); if (info == NULL) { if (finfo->uid == NULL) { printf("got fetch response for currently unknown message %u\n", id); goto done; } - uinfo = camel_folder_summary_uid(summary, finfo->uid); + uinfo = (CamelIMAPPMessageInfo *)camel_folder_summary_uid(summary, finfo->uid); if (uinfo) { /* we have a problem ... index mismatch */ printf("index mismatch, uid '%s' not at index '%u'\n", finfo->uid, id); - camel_folder_summary_info_free(summary, uinfo); + camel_message_info_free(uinfo); } /* pad out the summary till we have enough indexes */ for (i=camel_folder_summary_count(summary);i<id;i++) { - info = camel_folder_summary_info_new(summary); + info = camel_message_info_new(summary); if (i == id-1) { printf("inserting new info @ %u\n", i); - camel_message_info_set_uid(info, g_strdup(finfo->uid)); + info->info.uid = g_strdup(finfo->uid); } else { char uidtmp[32]; sprintf(uidtmp, "blank-%u", i); - camel_message_info_set_uid(info, g_strdup(uidtmp)); + info->info.uid = g_strdup(uidtmp); printf("inserting empty uid %s\n", uidtmp); } - camel_folder_summary_add(summary, info); + camel_folder_summary_add(summary, (CamelMessageInfo *)info); } - info = camel_folder_summary_index(summary, id-1); + info = (CamelIMAPPMessageInfo *)camel_folder_summary_index(summary, id-1); g_assert(info != NULL); } else { if (finfo->uid) { @@ -723,9 +723,9 @@ driver_resp_fetch(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata) finfo->uid, id, camel_message_info_uid(info)); camel_folder_change_info_remove_uid(sdata->folder->changes, camel_message_info_uid(info)); - camel_folder_summary_remove(summary, info); - camel_folder_summary_info_free(summary, info); - info = camel_folder_summary_index(summary, id-1); + camel_folder_summary_remove(summary, (CamelMessageInfo *)info); + camel_message_info_free(info); + info = (CamelIMAPPMessageInfo *)camel_folder_summary_index(summary, id-1); } } else { printf("got info for unknown message %u\n", id); @@ -735,19 +735,19 @@ driver_resp_fetch(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata) if (info) { if (finfo->got & FETCH_MINFO) { /* if we only use ENVELOPE? */ - camel_message_info_set_subject(info, g_strdup(camel_message_info_subject(finfo->minfo))); - camel_message_info_set_from(info, g_strdup(camel_message_info_from(finfo->minfo))); - camel_message_info_set_to(info, g_strdup(camel_message_info_to(finfo->minfo))); - camel_message_info_set_cc(info, g_strdup(camel_message_info_cc(finfo->minfo))); - info->date_sent = finfo->minfo->date_sent; + info->info.subject = g_strdup(camel_message_info_subject(finfo->minfo)); + info->info.from = g_strdup(camel_message_info_from(finfo->minfo)); + info->info.to = g_strdup(camel_message_info_to(finfo->minfo)); + info->info.cc = g_strdup(camel_message_info_cc(finfo->minfo)); + info->info.date_sent = camel_message_info_date_sent(finfo->minfo); camel_folder_change_info_add_uid(sdata->folder->changes, camel_message_info_uid(info)); printf("adding change info uid '%s'\n", camel_message_info_uid(info)); } if (finfo->got & FETCH_FLAGS) { - if ((info->flags & CAMEL_IMAPP_SERVER_FLAGS) != (finfo->flags & CAMEL_IMAPP_SERVER_FLAGS)) { + if ((info->info.flags & CAMEL_IMAPP_SERVER_FLAGS) != (camel_message_info_flags(finfo) & CAMEL_IMAPP_SERVER_FLAGS)) { camel_folder_change_info_change_uid(sdata->folder->changes, camel_message_info_uid(info)); - info->flags = (info->flags & ~(CAMEL_IMAPP_SERVER_FLAGS)) | (finfo->flags & CAMEL_IMAPP_SERVER_FLAGS); + info->info.flags = (info->info.flags & ~(CAMEL_IMAPP_SERVER_FLAGS)) | (camel_message_info_flags(finfo) & CAMEL_IMAPP_SERVER_FLAGS); camel_folder_summary_touch(summary); } ((CamelIMAPPMessageInfo *)info)->server_flags = finfo->flags & CAMEL_IMAPP_SERVER_FLAGS; @@ -770,7 +770,7 @@ driver_resp_fetch(CamelIMAPPEngine *ie, guint32 id, CamelIMAPPDriver *sdata) } } - camel_folder_summary_info_free(summary, info); + camel_message_info_free(info); } else { printf("dont know what to do with message\n"); } diff --git a/camel/providers/imapp/camel-imapp-folder.c b/camel/providers/imapp/camel-imapp-folder.c index aed7534afe..e85048d92c 100644 --- a/camel/providers/imapp/camel-imapp-folder.c +++ b/camel/providers/imapp/camel-imapp-folder.c @@ -68,7 +68,6 @@ imap_folder_class_init (CamelIMAPPFolderClass *camel_imapp_folder_class) camel_folder_class->sync = imap_sync; camel_folder_class->get_message = imap_get_message; - /*camel_folder_class->set_message_flags = imap_set_message_flags;*/ } static void diff --git a/camel/providers/imapp/camel-imapp-store.c b/camel/providers/imapp/camel-imapp-store.c index 23b6d3ca32..60d2816096 100644 --- a/camel/providers/imapp/camel-imapp-store.c +++ b/camel/providers/imapp/camel-imapp-store.c @@ -810,7 +810,7 @@ static int store_resp_fetch(CamelIMAPPEngine *ie, guint32 id, void *data) if (strcmp(finfo->uid, camel_message_info_uid(info)) != 0) { printf("summary at index %d has uid %s expected %s\n", id, camel_message_info_uid(info), finfo->uid); /* uid mismatch??? try do it based on uid instead? try to reorder? i dont know? */ - camel_folder_summary_info_free(((CamelFolder *)istore->selected)->summary, info); + camel_message_info_free(info); info = camel_folder_summary_uid(((CamelFolder *)istore->selected)->summary, finfo->uid); } } @@ -859,7 +859,7 @@ static int store_resp_fetch(CamelIMAPPEngine *ie, guint32 id, void *data) CamelMimeParser *mp; if (pending == NULL) - camel_folder_summary_info_free(((CamelFolder *)istore->selected)->summary, info); + camel_message_info_free(info); mp = camel_mime_parser_new(); camel_mime_parser_init_with_stream(mp, finfo->header); info = camel_folder_summary_info_new_from_parser(((CamelFolder *)istore->selected)->summary, mp); @@ -872,7 +872,7 @@ static int store_resp_fetch(CamelIMAPPEngine *ie, guint32 id, void *data) /* FIXME: use a dlist */ e_dlist_remove((EDListNode *)pending); g_hash_table_remove(istore->pending_fetch_table, camel_message_info_uid(pending->info)); - camel_folder_summary_info_free(((CamelFolder *)istore->selected)->summary, pending->info); + camel_message_info_free(pending->info); /*e_memchunk_free(istore->pending_fetch_chunks, pending);*/ } } else if (finfo->got & FETCH_FLAGS) { @@ -884,7 +884,7 @@ static int store_resp_fetch(CamelIMAPPEngine *ie, guint32 id, void *data) } } else { if (pending == NULL) - camel_folder_summary_info_free(((CamelFolder *)istore->selected)->summary, info); + camel_message_info_free(info); printf("got unexpected fetch response?\n"); imap_dump_fetch(finfo); } @@ -974,7 +974,7 @@ camel_imapp_store_folder_selected(CamelIMAPPStore *store, CamelIMAPPFolder *fold if (info) { printf("message info [%d] =\n", i); camel_message_info_dump(info); - camel_folder_summary_info_free(((CamelFolder *)istore->selected)->summary, info); + camel_message_info_free(info); } } } CAMEL_CATCH (e) { diff --git a/camel/providers/imapp/camel-imapp-store.h b/camel/providers/imapp/camel-imapp-store.h index 97b7afd1d1..ace5288986 100644 --- a/camel/providers/imapp/camel-imapp-store.h +++ b/camel/providers/imapp/camel-imapp-store.h @@ -44,7 +44,7 @@ struct _pending_fetch { struct _pending_fetch *next; struct _pending_fetch *prev; - CamelMessageInfo *info; + struct _CamelMessageInfo *info; }; typedef struct { diff --git a/camel/providers/imapp/camel-imapp-summary.c b/camel/providers/imapp/camel-imapp-summary.c index 05f0ec55c7..1b5a2c7155 100644 --- a/camel/providers/imapp/camel-imapp-summary.c +++ b/camel/providers/imapp/camel-imapp-summary.c @@ -168,7 +168,7 @@ message_info_load(CamelFolderSummary *s, FILE *in) return info; error: - camel_folder_summary_info_free(s, info); + camel_message_info_free(info); return NULL; } diff --git a/camel/providers/imapp/camel-imapp-summary.h b/camel/providers/imapp/camel-imapp-summary.h index 215ad2465a..1189bac075 100644 --- a/camel/providers/imapp/camel-imapp-summary.h +++ b/camel/providers/imapp/camel-imapp-summary.h @@ -42,7 +42,7 @@ typedef struct _CamelIMAPPSummaryClass CamelIMAPPSummaryClass; typedef struct _CamelIMAPPSummary CamelIMAPPSummary; typedef struct _CamelIMAPPMessageInfo { - CamelMessageInfo info; + CamelMessageInfoBase info; guint32 server_flags; } CamelIMAPPMessageInfo; diff --git a/camel/providers/imapp/camel-imapp-utils.c b/camel/providers/imapp/camel-imapp-utils.c index 19bdb3b036..51e0fe19b0 100644 --- a/camel/providers/imapp/camel-imapp-utils.c +++ b/camel/providers/imapp/camel-imapp-utils.c @@ -6,6 +6,7 @@ #include <camel/camel-folder-summary.h> #include <camel/camel-store.h> #include <camel/camel-utf8.h> +#include <camel/camel-string-utils.h> #include "camel-imapp-folder.h" #include "camel-imapp-stream.h" @@ -585,7 +586,7 @@ imap_parse_envelope(CamelIMAPPStream *is) unsigned char *token; struct _camel_header_address *addr, *addr_from; char *addrstr; - struct _CamelMessageInfo *minfo; + struct _CamelMessageInfoBase *minfo; /* envelope ::= "(" env_date SPACE env_subject SPACE env_from SPACE env_sender SPACE env_reply_to SPACE env_to @@ -594,7 +595,7 @@ imap_parse_envelope(CamelIMAPPStream *is) p(printf("envelope\n")); - minfo = camel_message_info_new(); + minfo = (CamelMessageInfoBase *)camel_message_info_new(NULL); CAMEL_TRY { tok = camel_imapp_stream_token(is, &token, &len); @@ -607,8 +608,7 @@ imap_parse_envelope(CamelIMAPPStream *is) /* env_subject ::= nstring */ tok = camel_imapp_stream_nstring(is, &token); - /* DUH: this free's it!: camel_message_info_set_subject(minfo, token); */ - e_poolv_set(minfo->strings, CAMEL_MESSAGE_INFO_SUBJECT, token, FALSE); + minfo->subject = camel_pstring_strdup(token); /* we merge from/sender into from, append should probably merge more smartly? */ @@ -630,7 +630,8 @@ imap_parse_envelope(CamelIMAPPStream *is) if (addr_from) { addrstr = camel_header_address_list_format(addr_from); - camel_message_info_set_from(minfo, addrstr); + minfo->from = camel_pstring_strdup(addrstr); + g_free(addrstr); camel_header_address_list_clear(&addr_from); } @@ -644,7 +645,8 @@ imap_parse_envelope(CamelIMAPPStream *is) addr = imap_parse_address_list(is); if (addr) { addrstr = camel_header_address_list_format(addr); - camel_message_info_set_to(minfo, addrstr); + minfo->to = camel_pstring_strdup(addrstr); + g_free(addrstr); camel_header_address_list_clear(&addr); } @@ -652,7 +654,8 @@ imap_parse_envelope(CamelIMAPPStream *is) addr = imap_parse_address_list(is); if (addr) { addrstr = camel_header_address_list_format(addr); - camel_message_info_set_cc(minfo, addrstr); + minfo->cc = camel_pstring_strdup(addrstr); + g_free(addrstr); camel_header_address_list_clear(&addr); } @@ -680,7 +683,7 @@ imap_parse_envelope(CamelIMAPPStream *is) camel_exception_throw_ex(ex); } CAMEL_DONE; - return minfo; + return (CamelMessageInfo *)minfo; } struct _CamelMessageContentInfo * @@ -771,7 +774,7 @@ imap_parse_body(CamelIMAPPStream *is) /* what do we do with the envelope?? */ minfo = imap_parse_envelope(is); /* what do we do with the message content info?? */ - minfo->content = imap_parse_body(is); + ((CamelMessageInfoBase *)minfo)->content = imap_parse_body(is); camel_message_info_free(minfo); minfo = NULL; d(printf("Scanned envelope - what do i do with it?\n")); diff --git a/camel/providers/imapp/camel-imapp-utils.h b/camel/providers/imapp/camel-imapp-utils.h index e0974bdc96..2734cd0dc3 100644 --- a/camel/providers/imapp/camel-imapp-utils.h +++ b/camel/providers/imapp/camel-imapp-utils.h @@ -65,8 +65,8 @@ struct _fetch_info { CamelStream *body; /* BODY[.*](<.*>)? */ CamelStream *text; /* RFC822.TEXT */ CamelStream *header; /* RFC822.HEADER */ - CamelMessageInfo *minfo; /* ENVELOPE */ - CamelMessageContentInfo *cinfo; /* BODYSTRUCTURE,BODY */ + struct _CamelMessageInfo *minfo; /* ENVELOPE */ + struct _CamelMessageContentInfo *cinfo; /* BODYSTRUCTURE,BODY */ guint32 size; /* RFC822.SIZE */ guint32 offset; /* start offset of a BODY[]<offset.length> request */ guint32 flags; /* FLAGS */ |