Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support display of format=flowed (rfc2646) #1835

Merged
merged 2 commits into from
Jan 1, 2017
Merged

support display of format=flowed (rfc2646) #1835

merged 2 commits into from
Jan 1, 2017

Conversation

Valodim
Copy link
Contributor

@Valodim Valodim commented Dec 6, 2016

What it says on the tin. This supports rfc2646 which specifies format=flowed, but not rfc3676 which adds the delsp parameter. That should be simple to add though.

@Valodim Valodim added the type: enhancement New features or improvements to existing features. label Dec 6, 2016
@@ -36,6 +36,10 @@ public static void setBody(Part part, Body body) throws MessagingException {
if (name != null) {
contentType += String.format(";\r\n name=\"%s\"", name);
}
boolean isFlowed = MimeUtility.isFormatFlowed(part.getContentType());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't support creating format=flowed messages. It looks like this is only for the benefit of the new test in MessageViewInfoExtractorTest. I'd rather have the test set the header after adding the body than adding to this already horrible method.

@@ -1137,4 +1140,11 @@ public static boolean isMessage(String mimeType) {
public static boolean isSameMimeType(String mimeType, String otherMimeType) {
return mimeType != null && mimeType.equalsIgnoreCase(otherMimeType);
}

static boolean isFormatFlowed(String contentType) {
if (TEXT_PLAIN.equalsIgnoreCase(getHeaderParameter(contentType, null))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracting the results of the getHeaderParameter() calls to local variables should make this easier to read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New features or improvements to existing features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants