Conditionally bind body on inline images downloaded

This commit is contained in:
M66B 2020-05-05 07:52:08 +02:00
parent af2752d15a
commit dd8a27bb00
1 changed files with 17 additions and 13 deletions

View File

@ -1389,6 +1389,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
db.attachment().liveAttachments(message.id).observe(cowner, new Observer<List<EntityAttachment>>() { db.attachment().liveAttachments(message.id).observe(cowner, new Observer<List<EntityAttachment>>() {
@Override @Override
public void onChanged(@Nullable List<EntityAttachment> attachments) { public void onChanged(@Nullable List<EntityAttachment> attachments) {
boolean show_images = properties.getValue("images", message.id);
boolean inline = prefs.getBoolean("inline_images", false);
if (show_images || inline) {
int inlineImages = 0; int inlineImages = 0;
if (attachments != null) if (attachments != null)
for (EntityAttachment attachment : attachments) for (EntityAttachment attachment : attachments)
@ -1404,6 +1407,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (inlineImages > lastInlineImages) if (inlineImages > lastInlineImages)
bindBody(message, false); bindBody(message, false);
}
bindAttachments(message, attachments); bindAttachments(message, attachments);
} }