diff --git a/app/src/main/java/eu/faircode/email/ActivityCompose.java b/app/src/main/java/eu/faircode/email/ActivityCompose.java index 325d9d6ebf..11b21c2759 100644 --- a/app/src/main/java/eu/faircode/email/ActivityCompose.java +++ b/app/src/main/java/eu/faircode/email/ActivityCompose.java @@ -36,7 +36,6 @@ import androidx.lifecycle.LifecycleOwner; import java.io.File; import java.util.ArrayList; -import java.util.Date; import java.util.List; import java.util.Map; @@ -243,13 +242,12 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB static Long undoSend(long id, Context context) { DB db = DB.getInstance(context); + // Cancel send EntityOperation operation = db.operation().getOperation(id, EntityOperation.SEND); if (operation != null) - if ("executing".equals(operation.state)) { - // Trigger update - db.message().setMessageUiBusy(id, new Date().getTime()); + if ("executing".equals(operation.state)) return null; - } else + else db.operation().deleteOperation(operation.id); EntityMessage message; diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 3153cb28d7..d33b9a3a1d 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -7108,6 +7108,15 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. long id = args.getLong("id"); DB db = DB.getInstance(context); + + // Cancel send operation + EntityOperation operation = db.operation().getOperation(id, EntityOperation.SEND); + if (operation != null) + if ("executing".equals(operation.state)) + return null; + else + db.operation().deleteOperation(operation.id); + try { db.beginTransaction();