aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/imap
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-05-04 10:31:00 -0700
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-05-04 10:31:29 -0700
commit7b03eb79d8d097f50f5eb4767850b3993a3b2d2d (patch)
treef8ccd206acc35dce79bf2a07741171d295f305b7 /src/core/imap
parente9ccd70a6dd9d17dec75e6c35189a0a2ae0f3cac (diff)
consistent uniqueID for MIME parts
Diffstat (limited to 'src/core/imap')
-rw-r--r--src/core/imap/MCIMAPPart.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/imap/MCIMAPPart.cc b/src/core/imap/MCIMAPPart.cc
index 9596533e..14b23c3a 100644
--- a/src/core/imap/MCIMAPPart.cc
+++ b/src/core/imap/MCIMAPPart.cc
@@ -83,12 +83,16 @@ unsigned int IMAPPart::decodedSize()
AbstractPart * IMAPPart::attachmentWithIMAPBody(struct mailimap_body * body)
{
String * partID;
+ AbstractPart * result;
partID = NULL;
if (body->bd_type == MAILIMAP_BODY_1PART) {
partID = MCSTR("1");
}
- return attachmentWithIMAPBodyInternal(body, partID);
+ result = attachmentWithIMAPBodyInternal(body, partID);
+ result->applyUniquePartID();
+
+ return result;
}
AbstractPart * IMAPPart::attachmentWithIMAPBodyInternal(struct mailimap_body * body, String * partID)
@@ -198,7 +202,6 @@ IMAPPart * IMAPPart::attachmentWithIMAPBody1PartBasic(struct mailimap_body_type_
attachment = new IMAPPart();
attachment->importIMAPFields(basic->bd_fields, extension);
- attachment->setUniqueID(mailcore::String::uuidString());
mimeType = NULL;
switch (basic->bd_media_basic->med_type) {
@@ -232,7 +235,6 @@ IMAPPart * IMAPPart::attachmentWithIMAPBody1PartText(struct mailimap_body_type_t
IMAPPart * attachment;
attachment = new IMAPPart();
- attachment->setUniqueID(mailcore::String::uuidString());
attachment->importIMAPFields(text->bd_fields, extension);
attachment->setMimeType(String::stringWithUTF8Format("text/%s", text->bd_media_text));