feat: also hide link card image previews according to showMediaPreview setting

This commit is contained in:
LucasGGamerM 2023-09-06 09:06:14 -03:00
parent e47fa4f8db
commit 090d2658dd
2 changed files with 3 additions and 3 deletions

View File

@ -27,10 +27,10 @@ public class LinkCardStatusDisplayItem extends StatusDisplayItem{
private final Status status;
private final UrlImageLoaderRequest imgRequest;
public LinkCardStatusDisplayItem(String parentID, BaseStatusListFragment parentFragment, Status status){
public LinkCardStatusDisplayItem(String parentID, BaseStatusListFragment parentFragment, Status status, boolean showImagePreview){
super(parentID, parentFragment);
this.status=status;
if(status.card.image!=null)
if(status.card.image!=null && showImagePreview)
imgRequest=new UrlImageLoaderRequest(status.card.image, 1000, 1000);
else
imgRequest=null;

View File

@ -285,7 +285,7 @@ public abstract class StatusDisplayItem{
buildPollItems(parentID, fragment, statusForContent.poll, contentItems, statusForContent);
}
if(statusForContent.card!=null && statusForContent.mediaAttachments.isEmpty()){
contentItems.add(new LinkCardStatusDisplayItem(parentID, fragment, statusForContent));
contentItems.add(new LinkCardStatusDisplayItem(parentID, fragment, statusForContent, (flags & FLAG_NO_MEDIA_PREVIEW)==0));
}
if(contentItems!=items && statusForContent.spoilerRevealed){
items.addAll(contentItems);