Skip to content

Commit 63804c5

Browse files
committed
Merge branch 'supported'
2 parents fd9b2a0 + 0d845e5 commit 63804c5

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

exch/ews/context.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,8 +1300,18 @@ void EWSContext::loadSpecial(const std::string& dir, uint64_t fid, uint64_t mid,
13001300
PROPTAG_ARRAY tags{std::size(tagIDs), tagIDs};
13011301
if (!exmdb.get_instance_properties(dir.c_str(), 0, aInst->instanceId, &tags, &props))
13021302
throw DispatchError(E3080);
1303+
sShape shape(props);
1304+
auto method = props.get<const uint32_t>(PR_ATTACH_METHOD);
1305+
if (method != nullptr && *method == ATTACH_EMBEDDED_MSG) {
1306+
auto eInst = m_plugin.loadEmbeddedInstance(dir, aInst->instanceId);
1307+
MESSAGE_CONTENT eInstContent{};
1308+
if (!exmdb.read_message_instance(dir.c_str(), eInst->instanceId, &eInstContent))
1309+
throw DispatchError(E3208);
1310+
auto log_id = dir + ":a" + std::to_string(i);
1311+
shape.mimeContent.emplace(exportContent(dir, eInstContent, log_id));
1312+
}
13031313
aid.attachment_num = i;
1304-
item.Attachments->emplace_back(tAttachment::create(aid, sShape(props)));
1314+
item.Attachments->emplace_back(tAttachment::create(aid, std::move(shape)));
13051315
}
13061316
}
13071317
if (special & sShape::Rights)

exch/ews/structures.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3348,7 +3348,8 @@ tItemAttachment::tItemAttachment(const sAttachmentId &aid, sShape &&shape) :
33483348
tAttachment(aid, shape)
33493349
{
33503350
Item.emplace(std::in_place_type_t<tMessage>(), sShape{});
3351-
std::get<tMessage>(*Item).MimeContent.emplace(std::move(*shape.mimeContent));
3351+
if (shape.mimeContent.has_value())
3352+
std::get<tMessage>(*Item).MimeContent.emplace(std::move(*shape.mimeContent));
33523353
}
33533354

33543355
tFileAttachment::tFileAttachment(const sAttachmentId& aid, const sShape& shape) : tAttachment(aid, shape)

0 commit comments

Comments
 (0)