diff --git a/src/body.cpp b/src/body.cpp index 50aa568..f2899a7 100644 --- a/src/body.cpp +++ b/src/body.cpp @@ -140,6 +140,18 @@ void Body::Parse() size_t current_index = 0; mailmime_parse(m_Data.c_str(), m_Data.size(), ¤t_index, &mime); + // clear all parsed members, in the event that it's a reparse due to version update + m_NumParts = 0; + m_PartInfos.clear(); + m_PartDatas.clear(); + m_TextPlainIndex = -1; + m_TextHtmlIndex = -1; + m_TextHtml.clear(); + m_TextPlain.clear(); + m_Html.clear(); + m_HtmlParsed = false; + m_PartDatasParsed = false; + if (mime != NULL) { ParseMime(mime, 0); @@ -502,7 +514,8 @@ size_t Body::GetCurrentParseVersion() { static std::hash hashStr; static size_t htmlToTextCmdHash = hashStr(Util::GetHtmlToTextConvertCmd()); - static size_t parseVersion = 1 + htmlToTextCmdHash; // update offset when parsing changes + static size_t parseVersionOffset = 1; // bump version offset when parsing changes + static size_t parseVersion = parseVersionOffset + htmlToTextCmdHash; return parseVersion; } diff --git a/src/nmail.1 b/src/nmail.1 index c1aa79e..1aae02c 100644 --- a/src/nmail.1 +++ b/src/nmail.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man. -.TH NMAIL "1" "June 2024" "nmail v4.67" "User Commands" +.TH NMAIL "1" "June 2024" "nmail v4.68" "User Commands" .SH NAME nmail \- ncurses mail .SH SYNOPSIS diff --git a/src/version.cpp b/src/version.cpp index 9933272..de7985d 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -7,7 +7,7 @@ #include "version.h" -#define NMAIL_VERSION "4.67" +#define NMAIL_VERSION "4.68" std::string Version::GetBuildOs() {