1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

It turns out that 79a96952f2 has caused a

lot of messages to be unreadable in K-9 3.8.  (see mailing list
threads)
This commit is contained in:
Jesse Vincent 2011-06-09 21:54:22 -04:00
parent c416f02d52
commit 379a8dfa9e
2 changed files with 5 additions and 11 deletions

View File

@ -1139,9 +1139,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
*/
bp.addHeader(MimeHeader.HEADER_CONTENT_DISPOSITION, String.format(
"attachment;\n filename=\"%s\";\n size=%d",
EncoderUtil.encodeIfNecessary(attachment.name,
EncoderUtil.Usage.WORD_ENTITY, 7),
attachment.size));
attachment.name, attachment.size));
mp.addBodyPart(bp);
}

View File

@ -18,7 +18,6 @@ import java.util.regex.Pattern;
import com.fsck.k9.helper.HtmlConverter;
import org.apache.commons.io.IOUtils;
import org.apache.james.mime4j.codec.EncoderUtil;
import android.app.Application;
import android.content.ContentValues;
@ -1670,17 +1669,14 @@ public class LocalStore extends Store implements Serializable {
MimeBodyPart bp = new LocalAttachmentBodyPart(body, id);
bp.setHeader(MimeHeader.HEADER_CONTENT_TRANSFER_ENCODING, "base64");
if (name != null) {
String encoded_name = EncoderUtil.encodeIfNecessary(name,
EncoderUtil.Usage.WORD_ENTITY, 7);
bp.setHeader(MimeHeader.HEADER_CONTENT_TYPE,
String.format("%s;\n name=\"%s\"",
type,
encoded_name));
name));
bp.setHeader(MimeHeader.HEADER_CONTENT_DISPOSITION,
String.format("%s;\n filename=\"%s\";\n size=%d",
contentDisposition,
encoded_name, // TODO: Should use encoded word defined in RFC 2231.
name, // TODO: Should use encoded word defined in RFC 2231.
size));
}
@ -2383,7 +2379,7 @@ public class LocalStore extends Store implements Serializable {
Utility.combine(attachment.getHeader(
MimeHeader.HEADER_ANDROID_ATTACHMENT_STORE_DATA), ',');
String name = MimeUtility.unfoldAndDecode(MimeUtility.getHeaderParameter(attachment.getContentType(), "name"));
String name = MimeUtility.getHeaderParameter(attachment.getContentType(), "name");
String contentId = MimeUtility.getHeaderParameter(attachment.getContentId(), null);
String contentDisposition = MimeUtility.unfoldAndDecode(attachment.getDisposition());
@ -2398,7 +2394,7 @@ public class LocalStore extends Store implements Serializable {
}
if (name == null && contentDisposition != null) {
name = MimeUtility.unfoldAndDecode(MimeUtility.getHeaderParameter(contentDisposition, "filename"));
name = MimeUtility.getHeaderParameter(contentDisposition, "filename");
}
if (attachmentId == -1) {
ContentValues cv = new ContentValues();