Invalidate headers on change/sync

pull/194/merge
M66B 4 years ago
parent 722cac9565
commit eaddfe2001

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

@ -53,6 +53,7 @@ import com.sun.mail.iap.Argument;
import com.sun.mail.iap.ProtocolException; import com.sun.mail.iap.ProtocolException;
import com.sun.mail.iap.Response; import com.sun.mail.iap.Response;
import com.sun.mail.imap.IMAPFolder; import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.IMAPMessage;
import com.sun.mail.imap.IMAPStore; import com.sun.mail.imap.IMAPStore;
import com.sun.mail.imap.protocol.IMAPProtocol; import com.sun.mail.imap.protocol.IMAPProtocol;
import com.sun.mail.imap.protocol.IMAPResponse; import com.sun.mail.imap.protocol.IMAPResponse;
@ -1654,7 +1655,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
public void messageChanged(MessageChangedEvent e) { public void messageChanged(MessageChangedEvent e) {
try { try {
wlMessage.acquire(); 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); Thread.sleep(FETCH_YIELD_DURATION);
} catch (Throwable ex) { } catch (Throwable ex) {
Log.e(folder.name, ex); Log.e(folder.name, ex);

Loading…
Cancel
Save