mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-03 21:55:13 +00:00
Fixed occasional wrong message text
This commit is contained in:
parent
b220aec166
commit
dcea0ce4a9
1 changed files with 9 additions and 10 deletions
|
@ -1470,8 +1470,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
}
|
||||
|
||||
private SimpleTask<SpannableStringBuilder> bodyTask = new SimpleTask<SpannableStringBuilder>() {
|
||||
private String body = null;
|
||||
|
||||
@Override
|
||||
protected void onPreExecute(Bundle args) {
|
||||
TupleMessageEx message = (TupleMessageEx) args.getSerializable("message");
|
||||
|
@ -1484,14 +1482,15 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
protected SpannableStringBuilder onExecute(Context context, final Bundle args) {
|
||||
DB db = DB.getInstance(context);
|
||||
TupleMessageEx message = (TupleMessageEx) args.getSerializable("message");
|
||||
if (body == null)
|
||||
try {
|
||||
body = Helper.readText(EntityMessage.getFile(context, message.id));
|
||||
} catch (IOException ex) {
|
||||
Log.e(ex);
|
||||
body = "";
|
||||
db.message().setMessageContent(message.id, false, null);
|
||||
}
|
||||
|
||||
String body;
|
||||
try {
|
||||
body = Helper.readText(EntityMessage.getFile(context, message.id));
|
||||
} catch (IOException ex) {
|
||||
Log.e(ex);
|
||||
db.message().setMessageContent(message.id, false, null);
|
||||
return null;
|
||||
}
|
||||
|
||||
Spanned html = decodeHtml(context, message, body);
|
||||
|
||||
|
|
Loading…
Reference in a new issue