Quote on send only

This commit is contained in:
M66B 2018-12-18 17:50:01 +01:00
parent a3cc6cd5b1
commit deab962e8a
3 changed files with 11 additions and 10 deletions

View File

@ -655,7 +655,7 @@ public class FragmentCompose extends FragmentEx {
Properties props = MessageHelper.getSessionProperties(Helper.AUTH_TYPE_PASSWORD, false);
Session isession = Session.getInstance(props, null);
MimeMessage imessage = new MimeMessage(isession);
MessageHelper.build(context, message, imessage);
MessageHelper.build(context, message, false, imessage);
// Serialize message
ByteArrayOutputStream os = new ByteArrayOutputStream();

View File

@ -174,7 +174,7 @@ public class MessageHelper {
return props;
}
static MimeMessageEx from(Context context, EntityMessage message, Session isession) throws MessagingException, IOException {
static MimeMessageEx from(Context context, EntityMessage message, boolean send, Session isession) throws MessagingException, IOException {
DB db = DB.getInstance(context);
MimeMessageEx imessage = new MimeMessageEx(isession, message.msgid);
@ -276,12 +276,12 @@ public class MessageHelper {
return imessage;
}
build(context, message, imessage);
build(context, message, send, imessage);
return imessage;
}
static void build(Context context, EntityMessage message, MimeMessage imessage) throws IOException, MessagingException {
static void build(Context context, EntityMessage message, boolean send, MimeMessage imessage) throws IOException, MessagingException {
DB db = DB.getInstance(context);
StringBuilder body = new StringBuilder();
@ -293,9 +293,10 @@ public class MessageHelper {
body.append(identity.signature);
}
if (message.replying != null || message.forwarding != null)
body.append(HtmlHelper.getQuote(context,
message.replying == null ? message.forwarding : message.replying, false));
if (send)
if (message.replying != null || message.forwarding != null)
body.append(HtmlHelper.getQuote(context,
message.replying == null ? message.forwarding : message.replying, false));
String plain = Jsoup.parse(body.toString()).text();

View File

@ -1624,7 +1624,7 @@ public class ServiceSynchronize extends LifecycleService {
private void doAdd(EntityFolder folder, Session isession, IMAPStore istore, IMAPFolder ifolder, EntityMessage message, JSONArray jargs, DB db) throws MessagingException, JSONException, IOException {
// Append message
MimeMessage imessage = MessageHelper.from(this, message, isession);
MimeMessage imessage = MessageHelper.from(this, message, false, isession);
if (EntityFolder.DRAFTS.equals(folder.type)) {
if (ifolder.getPermanentFlags().contains(Flags.Flag.DRAFT))
@ -1657,7 +1657,7 @@ public class ServiceSynchronize extends LifecycleService {
ifolder.expunge();
// Append target
MimeMessageEx icopy = MessageHelper.from(this, message, isession);
MimeMessageEx icopy = MessageHelper.from(this, message, false, isession);
Folder itarget = istore.getFolder(target.name);
itarget.appendMessages(new Message[]{icopy});
}
@ -1699,7 +1699,7 @@ public class ServiceSynchronize extends LifecycleService {
final Session isession = Session.getInstance(props, null);
// Create message
MimeMessage imessage = MessageHelper.from(this, message, isession);
MimeMessage imessage = MessageHelper.from(this, message, true, isession);
// Add reply to
if (ident.replyto != null)