mirror of https://github.com/M66B/FairEmail.git
Fixed signature location
This commit is contained in:
parent
2118fff65c
commit
abf77d7640
|
@ -1264,6 +1264,20 @@ public class HtmlHelper {
|
|||
|
||||
static void convertLists(Document document) {
|
||||
for (Element p : document.select("p")) {
|
||||
// Skip signature and referenced message
|
||||
boolean body = true;
|
||||
Element parent = p.parent();
|
||||
while (parent != null) {
|
||||
if ("div".equals(parent.tagName()) &&
|
||||
!TextUtils.isEmpty(parent.attr("fairemail"))) {
|
||||
body = false;
|
||||
break;
|
||||
}
|
||||
parent = parent.parent();
|
||||
}
|
||||
if (!body)
|
||||
continue;
|
||||
|
||||
Element list = null;
|
||||
for (int i = 0; i < p.childNodeSize(); i++) {
|
||||
boolean item = false;
|
||||
|
|
|
@ -36,7 +36,6 @@ import com.sun.mail.util.QDecoderStream;
|
|||
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.jsoup.select.Elements;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
|
@ -516,20 +515,10 @@ public class MessageHelper {
|
|||
|
||||
// When sending message
|
||||
if (identity != null) {
|
||||
Elements sig = document.select("div[fairemail=signature]");
|
||||
Elements ref = document.select("div[fairemail=reference]");
|
||||
sig.remove();
|
||||
ref.remove();
|
||||
|
||||
HtmlHelper.convertLists(document);
|
||||
|
||||
sig.removeAttr("fairemail");
|
||||
ref.removeAttr("fairemail");
|
||||
|
||||
for (Element e : sig)
|
||||
document.body().appendChild(e);
|
||||
for (Element e : ref)
|
||||
document.body().appendChild(e);
|
||||
document.select("div[fairemail=signature]").removeAttr("fairemail");
|
||||
document.select("div[fairemail=reference]").removeAttr("fairemail");
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue