diff options
Diffstat (limited to 'src/mdn')
-rw-r--r-- | src/mdn/receivedMDNInfos.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/mdn/receivedMDNInfos.cpp b/src/mdn/receivedMDNInfos.cpp index 1c523be7..53b2281e 100644 --- a/src/mdn/receivedMDNInfos.cpp +++ b/src/mdn/receivedMDNInfos.cpp @@ -110,18 +110,23 @@ void receivedMDNInfos::extract() header fields; fields.parse(oss.str()); - try { m_omid = *fields.OriginalMessageId()->getValue <messageId>(); } - catch (exceptions::no_such_field&) { /* Ignore */ } - - try { m_disp = *fields.Disposition()->getValue <disposition>(); } - catch (exceptions::no_such_field&) { /* Ignore */ } - - try - { - text t = *fields.findField("Received-content-MIC")->getValue <text>(); - m_contentMIC = t.generate(); - } - catch (exceptions::no_such_field&) { /* Ignore */ } + shared_ptr <messageId> omid = + fields.findFieldValue <messageId>(fields::ORIGINAL_MESSAGE_ID); + + if (omid) + m_omid = *omid; + + shared_ptr <disposition> disp = + fields.findFieldValue <disposition>(fields::DISPOSITION); + + if (disp) + m_disp = *disp; + + shared_ptr <text> contentMIC = + fields.findFieldValue <text>("Received-content-MIC"); + + if (contentMIC) + m_contentMIC = contentMIC->generate(); } } } |