Don't show preview cards on statuses with polls. (#2430)

Fixes #2427
This commit is contained in:
Levi Bard 2022-04-14 19:58:08 +02:00 committed by GitHub
parent 3e8c6a318a
commit ad077cf092
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1043,9 +1043,11 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
StatusDisplayOptions statusDisplayOptions, StatusDisplayOptions statusDisplayOptions,
final StatusActionListener listener final StatusActionListener listener
) { ) {
final Card card = status.getActionable().getCard(); final Status actionable = status.getActionable();
final Card card = actionable.getCard();
if (cardViewMode != CardViewMode.NONE && if (cardViewMode != CardViewMode.NONE &&
status.getActionable().getAttachments().size() == 0 && actionable.getAttachments().size() == 0 &&
actionable.getPoll() == null &&
card != null && card != null &&
!TextUtils.isEmpty(card.getUrl()) && !TextUtils.isEmpty(card.getUrl()) &&
(!status.isCollapsible() || !status.isCollapsed())) { (!status.isCollapsible() || !status.isCollapsed())) {
@ -1067,7 +1069,7 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
// Statuses from other activitypub sources can be marked sensitive even if there's no media, // Statuses from other activitypub sources can be marked sensitive even if there's no media,
// so let's blur the preview in that case // so let's blur the preview in that case
// If media previews are disabled, show placeholder for cards as well // If media previews are disabled, show placeholder for cards as well
if (statusDisplayOptions.mediaPreviewEnabled() && !status.getActionable().getSensitive() && !TextUtils.isEmpty(card.getImage())) { if (statusDisplayOptions.mediaPreviewEnabled() && !actionable.getSensitive() && !TextUtils.isEmpty(card.getImage())) {
int topLeftRadius = 0; int topLeftRadius = 0;
int topRightRadius = 0; int topRightRadius = 0;