extend media description warning to cross boost

This commit is contained in:
Thomas 2023-03-09 17:31:41 +01:00
parent 22b43db39b
commit 6a1a144ca3
1 changed files with 21 additions and 1 deletions

View File

@ -985,7 +985,27 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
if (statusToDeal.visibility.equals("direct") || (statusToDeal.visibility.equals("private"))) {
return true;
}
CrossActionHelper.doCrossAction(context, CrossActionHelper.TypeOfCrossAction.REBLOG_ACTION, null, statusToDeal);
boolean needToWarnForMissingDescription = false;
if (warnNoMedia && statusToDeal.media_attachments != null && statusToDeal.media_attachments.size() > 0) {
for (Attachment attachment : statusToDeal.media_attachments) {
if (attachment.description == null || attachment.description.trim().length() == 0) {
needToWarnForMissingDescription = true;
break;
}
}
}
if (needToWarnForMissingDescription) {
AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(context);
alt_bld.setMessage(context.getString(R.string.reblog_missing_description));
alt_bld.setPositiveButton(R.string.yes, (dialog, id) -> {
CrossActionHelper.doCrossAction(context, CrossActionHelper.TypeOfCrossAction.REBLOG_ACTION, null, statusToDeal);
});
alt_bld.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
AlertDialog alert = alt_bld.create();
alert.show();
} else {
CrossActionHelper.doCrossAction(context, CrossActionHelper.TypeOfCrossAction.REBLOG_ACTION, null, statusToDeal);
}
return true;
});
holder.binding.actionButtonBoost.setOnClickListener(v -> {