| 144 | } |
| 145 | |
| 146 | IMAPMessagePart * 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 | |
| 176 | void IMAPPart::importIMAPFields(struct mailimap_body_fields * fields, |
| 177 | struct mailimap_body_ext_1part * extension) |
nothing calls this directly
no test coverage detected