mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-27 02:07:12 +00:00
A multipart cannot be something else
This commit is contained in:
parent
c982e696a3
commit
5a17de17ba
1 changed files with 3 additions and 16 deletions
|
@ -31,7 +31,6 @@ import androidx.preference.PreferenceManager;
|
||||||
import com.sun.mail.gimap.GmailMessage;
|
import com.sun.mail.gimap.GmailMessage;
|
||||||
import com.sun.mail.iap.ProtocolException;
|
import com.sun.mail.iap.ProtocolException;
|
||||||
import com.sun.mail.imap.IMAPFolder;
|
import com.sun.mail.imap.IMAPFolder;
|
||||||
import com.sun.mail.imap.IMAPInputStream;
|
|
||||||
import com.sun.mail.imap.IMAPMessage;
|
import com.sun.mail.imap.IMAPMessage;
|
||||||
import com.sun.mail.imap.protocol.IMAPProtocol;
|
import com.sun.mail.imap.protocol.IMAPProtocol;
|
||||||
import com.sun.mail.util.ASCIIUtility;
|
import com.sun.mail.util.ASCIIUtility;
|
||||||
|
@ -2332,12 +2331,8 @@ public class MessageHelper {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (content instanceof String) {
|
|
||||||
String text = (String) content;
|
|
||||||
String sample = text.substring(0, Math.min(200, text.length()));
|
|
||||||
Log.e("Mixed string=" + sample);
|
|
||||||
} else
|
} else
|
||||||
Log.e("Mixed type=" + (content == null ? null : content.getClass().getName()));
|
throw new IllegalArgumentException("Multipart=" + (content == null ? null : content.getClass().getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (part.isMimeType("multipart/signed")) {
|
if (part.isMimeType("multipart/signed")) {
|
||||||
|
@ -2452,16 +2447,8 @@ public class MessageHelper {
|
||||||
Object content = part.getContent(); // Should always be Multipart
|
Object content = part.getContent(); // Should always be Multipart
|
||||||
if (content instanceof Multipart)
|
if (content instanceof Multipart)
|
||||||
multipart = (Multipart) part.getContent();
|
multipart = (Multipart) part.getContent();
|
||||||
else if (content instanceof String) {
|
else
|
||||||
String text = (String) content;
|
throw new IllegalArgumentException("Multipart=" + (content == null ? null : content.getClass().getName()));
|
||||||
String sample = text.substring(0, Math.min(200, text.length()));
|
|
||||||
throw new ParseException(content.getClass().getName() + ": " + sample);
|
|
||||||
} else if (content instanceof IMAPInputStream) {
|
|
||||||
String text = Helper.readStream((IMAPInputStream) content);
|
|
||||||
String sample = text.substring(0, Math.min(200, text.length()));
|
|
||||||
throw new ParseException(content.getClass().getName() + ": " + sample);
|
|
||||||
} else
|
|
||||||
throw new IllegalArgumentException(content.getClass().getName());
|
|
||||||
|
|
||||||
boolean other = false;
|
boolean other = false;
|
||||||
List<Part> plain = new ArrayList<>();
|
List<Part> plain = new ArrayList<>();
|
||||||
|
|
Loading…
Reference in a new issue