Commit c3d1e0a6 authored by Laurent Montel's avatar Laurent Montel 😁

Don't remove "X-KMail-Dictionary" which is can useful when we re-edit a sent mail

parent 0dd37f68
......@@ -675,7 +675,7 @@ QString quoteHtmlChars( const QString& str, bool removeLineBreaks )
return result;
}
void removePrivateHeaderFields( const KMime::Message::Ptr &message, bool removeIdentityTag )
void removePrivateHeaderFields( const KMime::Message::Ptr &message, bool cleanUpHeader )
{
message->removeHeader( "Status" );
message->removeHeader( "X-Status" );
......@@ -694,10 +694,12 @@ void removePrivateHeaderFields( const KMime::Message::Ptr &message, bool removeI
message->removeHeader( "X-KMail-UnExpanded-CC" );
message->removeHeader( "X-KMail-UnExpanded-BCC" );
message->removeHeader( "X-KMail-FccDisabled" );
message->removeHeader( "X-KMail-Dictionary" );
if(removeIdentityTag)
if(cleanUpHeader) {
message->removeHeader( "X-KMail-Identity" );
message->removeHeader( "X-KMail-Dictionary" );
}
}
QByteArray asSendableString( const KMime::Message::Ptr &originalMessage )
......
......@@ -105,8 +105,9 @@ MESSAGECORE_EXPORT QString quoteHtmlChars( const QString &text,
/**
* Removes all private header fields (e.g. *Status: and X-KMail-*) from the given @p message.
* if cleanUpHeader is false don't remove X-KMail-Identity and X-KMail-Dictionary which is useful when we want restore mail.
*/
MESSAGECORE_EXPORT void removePrivateHeaderFields(const KMime::Message::Ptr &message , bool removeIdentityTag = true);
MESSAGECORE_EXPORT void removePrivateHeaderFields(const KMime::Message::Ptr &message , bool cleanUpHeader = true);
/**
* Returns the @p message contents with the headers that should not be sent stripped off.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment