Invalidate headers on change/sync

This commit is contained in:
M66B 2022-01-19 18:59:12 +01:00
parent 722cac9565
commit eaddfe2001
2 changed files with 13 additions and 1 deletions

View File

@ -2221,6 +2221,10 @@ public class HtmlHelper {
return "border-" + dir + ":3px solid #ccc; padding-" + dir + ":3px;margin-top:0; margin-bottom:0;";
}
static String getIndentStyle(CharSequence quoted, int start, int end) {
return "margin-top:0; margin-bottom:0;";
}
static boolean hasBorder(Element e) {
if ("true".equals(e.attr("x-border")))
return true;
@ -3273,8 +3277,10 @@ public class HtmlHelper {
}
static String toHtml(Spanned spanned, Context context) {
Log.i("MMM text=" + spanned.toString().replace("\n", "|"));
HtmlEx converter = new HtmlEx(context);
String html = converter.toHtml(spanned, TO_HTML_PARAGRAPH_LINES_INDIVIDUAL);
Log.i("MMM html=" + html.replace("\n", "|"));
Document doc = JsoupEx.parse(html);
@ -3354,6 +3360,8 @@ public class HtmlHelper {
last.remove();
}
Log.i("MMM fixed=" + doc.html().replace("\n", "|"));
return doc.html();
}

View File

@ -53,6 +53,7 @@ import com.sun.mail.iap.Argument;
import com.sun.mail.iap.ProtocolException;
import com.sun.mail.iap.Response;
import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.IMAPMessage;
import com.sun.mail.imap.IMAPStore;
import com.sun.mail.imap.protocol.IMAPProtocol;
import com.sun.mail.imap.protocol.IMAPResponse;
@ -1654,7 +1655,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
public void messageChanged(MessageChangedEvent e) {
try {
wlMessage.acquire();
fetch(folder, ifolder, new Message[]{e.getMessage()}, false, "changed");
Message imessage = e.getMessage();
if (imessage instanceof IMAPMessage)
((IMAPMessage) imessage).invalidateHeaders();
fetch(folder, ifolder, new Message[]{imessage}, false, "changed");
Thread.sleep(FETCH_YIELD_DURATION);
} catch (Throwable ex) {
Log.e(folder.name, ex);