From 134fbaf2f0a6667488070ddb47de306835c9778d Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 1 Aug 2021 16:37:38 +0200 Subject: [PATCH] Refactoring --- app/src/main/java/eu/faircode/email/ActivityAnswer.java | 2 +- app/src/main/java/eu/faircode/email/EntityAnswer.java | 2 +- app/src/main/java/eu/faircode/email/EntityRule.java | 2 +- app/src/main/java/eu/faircode/email/FragmentCompose.java | 7 +++---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityAnswer.java b/app/src/main/java/eu/faircode/email/ActivityAnswer.java index 3d1deb58a7..1041a31c67 100644 --- a/app/src/main/java/eu/faircode/email/ActivityAnswer.java +++ b/app/src/main/java/eu/faircode/email/ActivityAnswer.java @@ -57,7 +57,7 @@ public class ActivityAnswer extends ActivityBase { public void onItemClick(AdapterView adapterView, View view, int pos, long id) { EntityAnswer answer = (EntityAnswer) adapterView.getAdapter().getItem(pos); - String html = answer.getText(null); + String html = answer.getHtml(null); String text = HtmlHelper.getText(ActivityAnswer.this, html); ClipboardManager cbm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); diff --git a/app/src/main/java/eu/faircode/email/EntityAnswer.java b/app/src/main/java/eu/faircode/email/EntityAnswer.java index 2f4cc5f3da..8ecd9326c6 100644 --- a/app/src/main/java/eu/faircode/email/EntityAnswer.java +++ b/app/src/main/java/eu/faircode/email/EntityAnswer.java @@ -67,7 +67,7 @@ public class EntityAnswer implements Serializable { public Integer applied = 0; public Long last_applied; - String getText(Address[] address) { + String getHtml(Address[] address) { return replacePlaceholders(text, address); } diff --git a/app/src/main/java/eu/faircode/email/EntityRule.java b/app/src/main/java/eu/faircode/email/EntityRule.java index c4f8a54646..15f9c54bf4 100644 --- a/app/src/main/java/eu/faircode/email/EntityRule.java +++ b/app/src/main/java/eu/faircode/email/EntityRule.java @@ -637,7 +637,7 @@ public class EntityRule { reply.id = db.message().insertMessage(reply); - String body = answer.getText(message.from); + String body = answer.getHtml(message.from); Document msg = JsoupEx.parse(body); Element div = msg.createElement("div"); diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 23f435a704..eebb105eb9 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -129,7 +129,6 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.bottomnavigation.BottomNavigationView; import com.google.android.material.bottomnavigation.LabelVisibilityMode; -import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.snackbar.Snackbar; import org.bouncycastle.cert.jcajce.JcaCertStore; @@ -4148,7 +4147,7 @@ public class FragmentCompose extends FragmentBase { if (a != null) { db.answer().applyAnswer(a.id, new Date().getTime()); data.draft.subject = a.name; - Document d = JsoupEx.parse(a.getText(null)); + Document d = JsoupEx.parse(a.getHtml(null)); document.body().append(d.body().html()); } @@ -4327,7 +4326,7 @@ public class FragmentCompose extends FragmentBase { else { db.answer().applyAnswer(receipt.id, new Date().getTime()); texts = new String[0]; - Document d = JsoupEx.parse(receipt.getText(null)); + Document d = JsoupEx.parse(receipt.getHtml(null)); document.body().append(d.body().html()); } } @@ -4372,7 +4371,7 @@ public class FragmentCompose extends FragmentBase { if (a != null) { db.answer().applyAnswer(a.id, new Date().getTime()); - Document d = JsoupEx.parse(a.getText(data.draft.to)); + Document d = JsoupEx.parse(a.getHtml(data.draft.to)); document.body().append(d.body().html()); }