MCPcopy Create free account
hub / github.com/MailCore/mailcore2 / attachmentWithIMAPBody1PartMessage

Method attachmentWithIMAPBody1PartMessage

src/core/imap/MCIMAPPart.cpp:146–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146IMAPMessagePart * IMAPPart::attachmentWithIMAPBody1PartMessage(struct mailimap_body_type_msg * message,
147 struct mailimap_body_ext_1part * extension,
148 String * partID)
149{
150 IMAPMessagePart * attachment;
151 AbstractPart * subAttachment;
152 String * nextPartID;
153
154 nextPartID = NULL;
155 if (message->bd_body->bd_type == MAILIMAP_BODY_1PART) {
156 // msg or 1part
157 nextPartID = partID->stringByAppendingUTF8Format(".1");
158 }
159 else if (message->bd_body->bd_type == MAILIMAP_BODY_MPART) {
160 // mpart
161 nextPartID = partID;
162 }
163
164 attachment = new IMAPMessagePart();
165 attachment->setPartID(partID);
166 attachment->header()->importIMAPEnvelope(message->bd_envelope);
167 attachment->importIMAPFields(message->bd_fields, extension);
168
169 subAttachment = attachmentWithIMAPBodyInternal(message->bd_body, nextPartID);
170 attachment->setMainPart(subAttachment);
171 attachment->setMimeType(MCSTR("message/rfc822"));
172
173 return (IMAPMessagePart *) attachment->autorelease();
174}
175
176void IMAPPart::importIMAPFields(struct mailimap_body_fields * fields,
177 struct mailimap_body_ext_1part * extension)

Callers

nothing calls this directly

Calls 8

importIMAPEnvelopeMethod · 0.80
setPartIDMethod · 0.45
headerMethod · 0.45
importIMAPFieldsMethod · 0.45
setMainPartMethod · 0.45
setMimeTypeMethod · 0.45
autoreleaseMethod · 0.45

Tested by

no test coverage detected