From: adam Date: Tue, 3 Aug 2004 07:17:25 +0000 (+0000) Subject: Address.toString() now offers long and short forms X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=16c65418e7f2aab3af08d5c603cea368fb1573f9;p=org.ibex.mail.git Address.toString() now offers long and short forms darcs-hash:20040803071725-5007d-52ab990f08b0f70ac26d8b477c162560125a13ea.gz --- diff --git a/src/org/ibex/mail/Address.java b/src/org/ibex/mail/Address.java index 4b3732a..c6cf90f 100644 --- a/src/org/ibex/mail/Address.java +++ b/src/org/ibex/mail/Address.java @@ -26,7 +26,9 @@ public class Address extends JSReflection { user = s.substring(0, s.indexOf('@')); host = s.substring(s.indexOf('@')+1); } - public String toString() { return description.equals("") ? (user +"@"+ host) : description+" <" + user +"@"+ host + ">"; } + public String toString() { return user + "@" + host; } + public String toString(boolean desc) { + return desc && description != null && description.length() > 0 ? (description+" <" + toString() + ">") : toString(); } public String coerceToString() { return toString(); } public static class Malformed extends Message.Malformed { public Malformed(String s) { super(s); } }