Fix an issue with media when sensitive with boost

This commit is contained in:
tom79 2019-05-09 17:55:24 +02:00
parent f934cb3a20
commit aa7d4ab054
1 changed files with 8 additions and 4 deletions

View File

@ -1595,7 +1595,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
if(behaviorWithAttachments != Helper.ATTACHMENT_ASK ) { if(behaviorWithAttachments != Helper.ATTACHMENT_ASK ) {
//If medias are loaded without any conditions or if device is on wifi //If medias are loaded without any conditions or if device is on wifi
if (expand_media || !status.getReblog().isSensitive() && (behaviorWithAttachments == Helper.ATTACHMENT_ALWAYS || (behaviorWithAttachments == Helper.ATTACHMENT_WIFI && isOnWifi))) { if (expand_media || !status.getReblog().isSensitive() && (behaviorWithAttachments == Helper.ATTACHMENT_ALWAYS || (behaviorWithAttachments == Helper.ATTACHMENT_WIFI && isOnWifi))) {
loadAttachments(status.getReblog(), holder, false); loadAttachments(status, holder, false);
holder.status_show_more.setVisibility(View.GONE); holder.status_show_more.setVisibility(View.GONE);
status.setAttachmentShown(true); status.setAttachmentShown(true);
} else { } else {
@ -1612,7 +1612,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
loadAttachments(status, holder, true); loadAttachments(status, holder, true);
} }
} else { } else {
loadAttachments(status.getReblog(), holder, false); loadAttachments(status, holder, false);
} }
} }
}else{ }else{
@ -1626,7 +1626,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
else else
holder.status_document_container.setVisibility(View.GONE); holder.status_document_container.setVisibility(View.GONE);
} else { } else {
loadAttachments(status.getReblog(), holder, false); loadAttachments(status, holder, false);
} }
} }
} }
@ -2735,7 +2735,11 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
private void loadAttachments(final Status status, final ViewHolder holder, boolean blur){ private void loadAttachments(final Status status, final ViewHolder holder, boolean blur){
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE); SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
boolean fullAttachement = sharedpreferences.getBoolean(Helper.SET_FULL_PREVIEW, false); boolean fullAttachement = sharedpreferences.getBoolean(Helper.SET_FULL_PREVIEW, false);
List<Attachment> attachments = status.getMedia_attachments(); List<Attachment> attachments;
if( status.getReblog() != null)
attachments = status.getReblog().getMedia_attachments();
else
attachments = status.getMedia_attachments();
if( !blur) if( !blur)
holder.status_show_more.setVisibility(View.GONE); holder.status_show_more.setVisibility(View.GONE);
else else