From 1226acd11a797c5cac2c8f49135f7518bd2ab1ca Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 22 Sep 2018 06:13:53 +0000 Subject: [PATCH] Warn when forwarding if not all attachments are downloaded Fixes #137 --- .../eu/faircode/email/FragmentMessage.java | 37 +++++++++++++++++-- app/src/main/res/values-af/strings.xml | 1 + app/src/main/res/values-ar-rBH/strings.xml | 1 + app/src/main/res/values-ar-rEG/strings.xml | 1 + app/src/main/res/values-ar-rSA/strings.xml | 1 + app/src/main/res/values-ar-rYE/strings.xml | 1 + app/src/main/res/values-ar/strings.xml | 1 + app/src/main/res/values-ca/strings.xml | 1 + app/src/main/res/values-cs/strings.xml | 1 + app/src/main/res/values-da/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-el/strings.xml | 1 + app/src/main/res/values-en/strings.xml | 1 + app/src/main/res/values-es-rES/strings.xml | 1 + app/src/main/res/values-fi/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-he/strings.xml | 1 + app/src/main/res/values-hu/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-iw/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-ko/strings.xml | 1 + app/src/main/res/values-nb/strings.xml | 1 + app/src/main/res/values-nl/strings.xml | 1 + app/src/main/res/values-no/strings.xml | 1 + app/src/main/res/values-pl/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-pt-rPT/strings.xml | 1 + app/src/main/res/values-ro/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-sr/strings.xml | 1 + app/src/main/res/values-sv-rSE/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values-uk/strings.xml | 1 + app/src/main/res/values-vi/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 38 files changed, 71 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessage.java b/app/src/main/java/eu/faircode/email/FragmentMessage.java index 8f1eb4ba36..dfabebb940 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessage.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessage.java @@ -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() { + @Override + protected Boolean onLoad(Context context, Bundle args) { + long id = args.getLong("id"); + List 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() { diff --git a/app/src/main/res/values-af/strings.xml b/app/src/main/res/values-af/strings.xml index 7669c11721..0cbe5d93d2 100644 --- a/app/src/main/res/values-af/strings.xml +++ b/app/src/main/res/values-af/strings.xml @@ -160,6 +160,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-ar-rBH/strings.xml b/app/src/main/res/values-ar-rBH/strings.xml index 9730d96c0d..a3a3dac428 100644 --- a/app/src/main/res/values-ar-rBH/strings.xml +++ b/app/src/main/res/values-ar-rBH/strings.xml @@ -176,6 +176,7 @@ نقل الرسالة إلى %1$s لا يوجد عارض التطبيق متاح ل %1$s حفظ المرفقات + Some attachments are not downloaded and will not be forwarded, continue? هل تريد حذف الرسالة بشكل دائم؟ رسالة التقرير كالبريد المزعج؟ إنشاء diff --git a/app/src/main/res/values-ar-rEG/strings.xml b/app/src/main/res/values-ar-rEG/strings.xml index 9730d96c0d..a3a3dac428 100644 --- a/app/src/main/res/values-ar-rEG/strings.xml +++ b/app/src/main/res/values-ar-rEG/strings.xml @@ -176,6 +176,7 @@ نقل الرسالة إلى %1$s لا يوجد عارض التطبيق متاح ل %1$s حفظ المرفقات + Some attachments are not downloaded and will not be forwarded, continue? هل تريد حذف الرسالة بشكل دائم؟ رسالة التقرير كالبريد المزعج؟ إنشاء diff --git a/app/src/main/res/values-ar-rSA/strings.xml b/app/src/main/res/values-ar-rSA/strings.xml index 9730d96c0d..a3a3dac428 100644 --- a/app/src/main/res/values-ar-rSA/strings.xml +++ b/app/src/main/res/values-ar-rSA/strings.xml @@ -176,6 +176,7 @@ نقل الرسالة إلى %1$s لا يوجد عارض التطبيق متاح ل %1$s حفظ المرفقات + Some attachments are not downloaded and will not be forwarded, continue? هل تريد حذف الرسالة بشكل دائم؟ رسالة التقرير كالبريد المزعج؟ إنشاء diff --git a/app/src/main/res/values-ar-rYE/strings.xml b/app/src/main/res/values-ar-rYE/strings.xml index 9730d96c0d..a3a3dac428 100644 --- a/app/src/main/res/values-ar-rYE/strings.xml +++ b/app/src/main/res/values-ar-rYE/strings.xml @@ -176,6 +176,7 @@ نقل الرسالة إلى %1$s لا يوجد عارض التطبيق متاح ل %1$s حفظ المرفقات + Some attachments are not downloaded and will not be forwarded, continue? هل تريد حذف الرسالة بشكل دائم؟ رسالة التقرير كالبريد المزعج؟ إنشاء diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 9730d96c0d..a3a3dac428 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -176,6 +176,7 @@ نقل الرسالة إلى %1$s لا يوجد عارض التطبيق متاح ل %1$s حفظ المرفقات + Some attachments are not downloaded and will not be forwarded, continue? هل تريد حذف الرسالة بشكل دائم؟ رسالة التقرير كالبريد المزعج؟ إنشاء diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 7669c11721..0cbe5d93d2 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -160,6 +160,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 51862b42c8..842438f228 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -168,6 +168,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index b3b0e4749d..2c5c379ffe 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -160,6 +160,7 @@ Flytter besked til %1$s Ingen viewer app til rådighed for %1$s Vedhæftet fil gemt + Some attachments are not downloaded and will not be forwarded, continue? Slet meddelelsen permanent? Rapportér meddelelse som spam? Ny meddelelse diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 486d8d369a..3f9f7d38af 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -160,6 +160,7 @@ Verschiebe E-Mail nach %1$s Keine App zum Betrachten von %1$s Anhang gespeichert + Some attachments are not downloaded and will not be forwarded, continue? E-Mail dauerhaft löschen? Nachricht als Spam melden? Verfassen diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 7669c11721..0cbe5d93d2 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -160,6 +160,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index 7669c11721..0cbe5d93d2 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -160,6 +160,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index de9daa2fd5..e8b7836bc4 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -160,6 +160,7 @@ Moviendo mensaje a %1$s No hay app disponible para visualizar %1$s Adjunto guardado + Some attachments are not downloaded and will not be forwarded, continue? ¿Eliminar mensaje permanentemente? ¿Reportar mensaje como spam? Redactar diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 7669c11721..0cbe5d93d2 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -160,6 +160,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index ee2f6af7ce..e319593ead 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -160,6 +160,7 @@ Déplacement du message vers %1$s Aucune application disponible pour visionner %1$s Pièce jointe enregistrée + Some attachments are not downloaded and will not be forwarded, continue? Supprimer ce message définitivement ? Signaler le message comme spam ? Rédiger diff --git a/app/src/main/res/values-he/strings.xml b/app/src/main/res/values-he/strings.xml index 60dfb3fc65..fa2f27e800 100644 --- a/app/src/main/res/values-he/strings.xml +++ b/app/src/main/res/values-he/strings.xml @@ -168,6 +168,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 7669c11721..0cbe5d93d2 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -160,6 +160,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 46b2ebcd65..1e3248323e 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -160,6 +160,7 @@ Spostamento messaggio in %1$s Nessuna app di visualizzazione disponibile per %1$s Allegato salvato + Some attachments are not downloaded and will not be forwarded, continue? Eliminare il messaggio permanentemente? Segnalare il messaggio come posta indesiderata? Scrivi diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml index 60dfb3fc65..fa2f27e800 100644 --- a/app/src/main/res/values-iw/strings.xml +++ b/app/src/main/res/values-iw/strings.xml @@ -168,6 +168,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 91e6c5d6d1..dc71212a49 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -156,6 +156,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 91e6c5d6d1..dc71212a49 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -156,6 +156,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml index 7669c11721..0cbe5d93d2 100644 --- a/app/src/main/res/values-nb/strings.xml +++ b/app/src/main/res/values-nb/strings.xml @@ -160,6 +160,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 7669c11721..0cbe5d93d2 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -160,6 +160,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-no/strings.xml b/app/src/main/res/values-no/strings.xml index 7669c11721..0cbe5d93d2 100644 --- a/app/src/main/res/values-no/strings.xml +++ b/app/src/main/res/values-no/strings.xml @@ -160,6 +160,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index cba484e5f9..7744f0fb84 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -168,6 +168,7 @@ Przenoszenie wiadomości do %1$s Brak aplikacji do podglądu %1$s Załącznik zapisany + Some attachments are not downloaded and will not be forwarded, continue? Usunąć wiadomość bezpowrotnie? Zgłosić wiadomość jako spam? Napisz diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index e177259d11..eb4641a15a 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -160,6 +160,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Deletar mensagem permanentemente? Reportar mensagem com spam? Escrever diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 7669c11721..0cbe5d93d2 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -160,6 +160,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 61b27149c8..2ee01e2661 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -164,6 +164,7 @@ Mesajul se mută în %1$s Nici o aplicație nu poate deschide %1$s Atașament salvat + Some attachments are not downloaded and will not be forwarded, continue? Ștergeți definitiv mesajul? Raportați mesajul drept spam? Compune diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 51862b42c8..842438f228 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -168,6 +168,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index 2dbd9bdae3..26e8bf7356 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -164,6 +164,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-sv-rSE/strings.xml b/app/src/main/res/values-sv-rSE/strings.xml index 7669c11721..0cbe5d93d2 100644 --- a/app/src/main/res/values-sv-rSE/strings.xml +++ b/app/src/main/res/values-sv-rSE/strings.xml @@ -160,6 +160,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index a90c6d0a84..bae3f91d14 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -160,6 +160,7 @@ İleti şuraya taşınıyor %1$s %1$s için kullanılabilir hiçbir görüntüleme uygulaması yok Ek kaydedildi + Some attachments are not downloaded and will not be forwarded, continue? İletiyi kalıcı olarak sil? İletiyi spam olarak raporla? Oluştur diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 51862b42c8..842438f228 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -168,6 +168,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 91e6c5d6d1..dc71212a49 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -156,6 +156,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index f5889c64b7..0915681a01 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -156,6 +156,7 @@ 移动邮件至%1$s 未找到能打开%1$s的应用程序 附件已保存 + Some attachments are not downloaded and will not be forwarded, continue? 确定要永久删除邮件吗? 确定将邮件标为垃圾邮件吗? 新邮件 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 91e6c5d6d1..dc71212a49 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -156,6 +156,7 @@ Moving message to %1$s No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam? Compose diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index fb6c6ac60f..f33816db3d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -186,6 +186,7 @@ No viewer app available for %1$s Attachment saved + Some attachments are not downloaded and will not be forwarded, continue? Delete message permanently? Report message as spam?