Fixed occasional wrong message text

pull/147/head
M66B 6 years ago
parent b220aec166
commit dcea0ce4a9

@ -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…
Cancel
Save