1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-01-11 21:58:35 -05:00
This commit is contained in:
Jesse Vincent 2011-01-19 21:33:23 +00:00
parent 8329a0287b
commit a234c39722
2 changed files with 24 additions and 15 deletions

View File

@ -131,8 +131,7 @@ public class Address
public static Address[] parse(String addressList)
{
ArrayList<Address> addresses = new ArrayList<Address>();
if (addressList == null
&& !"".equals(addressList))
if (addressList == null && !"".equals(addressList))
{
return EMPTY_ADDRESS_ARRAY;
}
@ -147,11 +146,12 @@ public class Address
Mailbox mailbox = (Mailbox)address;
if (mailbox.getName() != null )
{
addresses.add(new Address(mailbox.getLocalPart() + "@" + mailbox.getDomain(), mailbox.getName()));
} else
{
addresses.add(new Address(mailbox.getLocalPart() + "@" + mailbox.getDomain()));
}
addresses.add(new Address(mailbox.getLocalPart() + "@" + mailbox.getDomain(), mailbox.getName()));
}
else
{
addresses.add(new Address(mailbox.getLocalPart() + "@" + mailbox.getDomain()));
}
}
else
{

View File

@ -78,10 +78,13 @@ public class MimeMessage extends Message
MimeStreamParser parser = new MimeStreamParser();
parser.setContentHandler(new MimeMessageBuilder());
try {
try
{
parser.parse(new EOLConvertingInputStream(in));
} catch (MimeException me) {
throw new Error(me);
}
catch (MimeException me)
{
throw new Error(me);
}
}
@ -576,12 +579,18 @@ public class MimeMessage extends Message
public void field(RawField field)
{
try {
Field parsedField = DefaultFieldParser.parse(field.getRaw(), null);
((Part)stack.peek()).addHeader(parsedField.getName(), field.getBody().trim());
} catch (MessagingException me) {
expect(Part.class);
try
{
Field parsedField = DefaultFieldParser.parse(field.getRaw(), null);
((Part)stack.peek()).addHeader(parsedField.getName(), parsedField.getBody().trim());
}
catch (MessagingException me)
{
throw new Error(me);
} catch (MimeException me) {
}
catch (MimeException me)
{
throw new Error(me);
}
}