diff --git a/src/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java index b649a4efc1..af31833c79 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushGroupSendJob.java @@ -139,8 +139,6 @@ public class PushGroupSendJob extends PushSendJob implements InjectableType { @Override public void onCanceled() { - super.onCanceled(); - DatabaseFactory.getMmsDatabase(context).markAsSentFailed(messageId); } diff --git a/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java index eb1fae63cb..51ed31232f 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java @@ -94,8 +94,6 @@ public class PushMediaSendJob extends PushSendJob implements InjectableType { @Override public void onCanceled() { - super.onCanceled(); - DatabaseFactory.getMmsDatabase(context).markAsSentFailed(messageId); notifyMediaMessageDeliveryFailed(context, messageId); } diff --git a/src/org/thoughtcrime/securesms/jobs/PushSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushSendJob.java index 9d3bb631ca..8cca4dd4e1 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushSendJob.java @@ -74,8 +74,12 @@ public abstract class PushSendJob extends SendJob { } @Override - public void onCanceled() { - ApplicationContext.getInstance(context).getJobManager().add(new ServiceOutageDetectionJob(context)); + public void onRetry() { + super.onRetry(); + + if (getRunIteration() > 1) { + ApplicationContext.getInstance(context).getJobManager().add(new ServiceOutageDetectionJob(context)); + } } protected Optional getProfileKey(@NonNull Recipient recipient) { diff --git a/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java index 9efc8895f8..58b3967c43 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java @@ -83,8 +83,6 @@ public class PushTextSendJob extends PushSendJob implements InjectableType { @Override public void onCanceled() { - super.onCanceled(); - DatabaseFactory.getSmsDatabase(context).markAsSentFailed(messageId); long threadId = DatabaseFactory.getSmsDatabase(context).getThreadIdForMessage(messageId);