Changeset View
Changeset View
Standalone View
Standalone View
mimetreeparser/src/bodyformatter/utils.cpp
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | |||||
54 | { | 54 | { | ||
55 | foreach (const auto &mp, messageTree->subParts()) { | 55 | foreach (const auto &mp, messageTree->subParts()) { | ||
56 | auto text = mp.dynamicCast<TextMessagePart>(); | 56 | auto text = mp.dynamicCast<TextMessagePart>(); | ||
57 | auto attach = mp.dynamicCast<AttachmentMessagePart>(); | 57 | auto attach = mp.dynamicCast<AttachmentMessagePart>(); | ||
58 | if (text && !attach) { | 58 | if (text && !attach) { | ||
59 | return text; | 59 | return text; | ||
60 | } else if (const auto alternative = mp.dynamicCast<AlternativeMessagePart>()) { | 60 | } else if (const auto alternative = mp.dynamicCast<AlternativeMessagePart>()) { | ||
61 | return alternative; | 61 | return alternative; | ||
62 | } else if (const auto m = mp.dynamicCast<MessagePart>()) { | 62 | } else { | ||
63 | auto ret = toplevelTextNode(m); | 63 | auto ret = toplevelTextNode(mp); | ||
64 | if (ret) { | 64 | if (ret) { | ||
65 | return ret; | 65 | return ret; | ||
66 | } | 66 | } | ||
67 | } | 67 | } | ||
68 | } | 68 | } | ||
69 | return MessagePart::Ptr(); | 69 | return MessagePart::Ptr(); | ||
70 | } | 70 | } |