mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 19:34:15 +01:00
@@ -729,9 +729,40 @@ public class FragmentMessage extends FragmentEx {
|
||||
}
|
||||
|
||||
private void onMenuForward() {
|
||||
startActivity(new Intent(getContext(), ActivityCompose.class)
|
||||
.putExtra("action", "forward")
|
||||
.putExtra("reference", message.id));
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("id", message.id);
|
||||
|
||||
new SimpleTask<Boolean>() {
|
||||
@Override
|
||||
protected Boolean onLoad(Context context, Bundle args) {
|
||||
long id = args.getLong("id");
|
||||
List<EntityAttachment> attachments = DB.getInstance(context).attachment().getAttachments(id);
|
||||
for (EntityAttachment attachment : attachments)
|
||||
if (!attachment.available)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLoaded(Bundle args, Boolean available) {
|
||||
final Intent forward = new Intent(getContext(), ActivityCompose.class)
|
||||
.putExtra("action", "forward")
|
||||
.putExtra("reference", message.id);
|
||||
if (available)
|
||||
startActivity(forward);
|
||||
else
|
||||
new DialogBuilderLifecycle(getContext(), getViewLifecycleOwner())
|
||||
.setMessage(R.string.title_attachment_unavailable)
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
startActivity(forward);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.show();
|
||||
}
|
||||
}.load(this, args);
|
||||
}
|
||||
|
||||
private void onMenuReplyAll() {
|
||||
|
||||
Reference in New Issue
Block a user