forked from I2P_Developers/i2p.i2p
SusiMail: Don't duplicate Re: and Fwd:
final formatters store Message-ID
This commit is contained in:
@@ -77,6 +77,7 @@ class Mail {
|
||||
String[] to, cc; // addresses only, enclosed by <>
|
||||
private boolean isNew, isSpam;
|
||||
public String contentType;
|
||||
public String messageID; // as received, trimmed only, probably enclosed with <>, not HTML escaped
|
||||
|
||||
public String error;
|
||||
|
||||
@@ -282,9 +283,9 @@ class Mail {
|
||||
}
|
||||
|
||||
private static final DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
private static DateFormat localDateFormatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
|
||||
private static DateFormat longLocalDateFormatter = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
|
||||
private static DateFormat mailDateFormatter = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z", Locale.ENGLISH );
|
||||
private static final DateFormat localDateFormatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
|
||||
private static final DateFormat longLocalDateFormatter = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
|
||||
private static final DateFormat mailDateFormatter = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z", Locale.ENGLISH );
|
||||
static {
|
||||
// the router sets the JVM time zone to UTC but saves the original here so we can get it
|
||||
TimeZone tz = SystemVersion.getSystemTimeZone();
|
||||
@@ -410,6 +411,8 @@ class Mail {
|
||||
// we want to know if we have attachments, even if
|
||||
// we haven't fetched the body
|
||||
contentType = line.substring(13).trim();
|
||||
} else if (hlc.startsWith("message-id:")) {
|
||||
messageID = line.substring(11).trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1088,7 +1088,11 @@ public class WebMail extends HttpServlet
|
||||
sessionObject.replyTo = mail.reply;
|
||||
else if( mail.sender != null && Mail.validateAddress( mail.sender ) )
|
||||
sessionObject.replyTo = mail.sender;
|
||||
sessionObject.subject = _t("Re:") + ' ' + mail.formattedSubject;
|
||||
sessionObject.subject = mail.formattedSubject;
|
||||
if (!(sessionObject.subject.startsWith("Re:") ||
|
||||
sessionObject.subject.startsWith(_t("Re:")))) {
|
||||
sessionObject.subject = _t("Re:") + ' ' + sessionObject.subject;
|
||||
}
|
||||
StringWriter text = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter( text );
|
||||
pw.println( _t("On {0} {1} wrote:", mail.formattedDate + " UTC", sessionObject.replyTo) );
|
||||
@@ -1126,7 +1130,11 @@ public class WebMail extends HttpServlet
|
||||
sessionObject.replyCC = buf.toString();
|
||||
}
|
||||
if( forward ) {
|
||||
sessionObject.subject = _t("Fwd:") + ' ' + mail.formattedSubject;
|
||||
sessionObject.subject = mail.formattedSubject;
|
||||
if (!(sessionObject.subject.startsWith("Fwd:") ||
|
||||
sessionObject.subject.startsWith(_t("Fwd:")))) {
|
||||
sessionObject.subject = _t("Fwd:") + ' ' + sessionObject.subject;
|
||||
}
|
||||
String sender = null;
|
||||
if( mail.reply != null && Mail.validateAddress( mail.reply ) )
|
||||
sender = Mail.getAddress( mail.reply );
|
||||
|
||||
Reference in New Issue
Block a user