From cc65fab226fca0267631627cb298b6bed637c62c Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Fri, 13 Mar 2015 11:29:44 -0700 Subject: [PATCH] Update message details activity display when resending SMS/MMS // FREEBIE --- src/org/thoughtcrime/securesms/MessageRecipientListItem.java | 2 ++ src/org/thoughtcrime/securesms/jobs/MmsSendJob.java | 3 ++- src/org/thoughtcrime/securesms/jobs/SmsSendJob.java | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/MessageRecipientListItem.java b/src/org/thoughtcrime/securesms/MessageRecipientListItem.java index 11dbdad6b2..06547fe982 100644 --- a/src/org/thoughtcrime/securesms/MessageRecipientListItem.java +++ b/src/org/thoughtcrime/securesms/MessageRecipientListItem.java @@ -109,12 +109,14 @@ public class MessageRecipientListItem extends RelativeLayout }); } else if (networkFailure != null || (!isPushGroup && record.isFailed())) { resendButton.setVisibility(View.VISIBLE); + resendButton.setEnabled(true); conflictButton.setVisibility(View.GONE); errorText = getContext().getString(R.string.MessageDetailsRecipient_failed_to_send); resendButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { + resendButton.setEnabled(false); new ResendAsyncTask(masterSecret, record, networkFailure).execute(); } }); diff --git a/src/org/thoughtcrime/securesms/jobs/MmsSendJob.java b/src/org/thoughtcrime/securesms/jobs/MmsSendJob.java index 3cd6915b07..bd7485b55f 100644 --- a/src/org/thoughtcrime/securesms/jobs/MmsSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/MmsSendJob.java @@ -54,7 +54,8 @@ public class MmsSendJob extends SendJob { @Override public void onAdded() { - + MmsDatabase database = DatabaseFactory.getMmsDatabase(context); + database.markAsSending(messageId); } @Override diff --git a/src/org/thoughtcrime/securesms/jobs/SmsSendJob.java b/src/org/thoughtcrime/securesms/jobs/SmsSendJob.java index c22e084d90..06e21eeb7f 100644 --- a/src/org/thoughtcrime/securesms/jobs/SmsSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/SmsSendJob.java @@ -11,6 +11,7 @@ import org.thoughtcrime.securesms.crypto.MasterSecret; import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.EncryptingSmsDatabase; import org.thoughtcrime.securesms.database.NoSuchMessageException; +import org.thoughtcrime.securesms.database.SmsDatabase; import org.thoughtcrime.securesms.database.model.SmsMessageRecord; import org.thoughtcrime.securesms.jobs.requirements.MasterSecretRequirement; import org.thoughtcrime.securesms.jobs.requirements.NetworkOrServiceRequirement; @@ -39,7 +40,8 @@ public class SmsSendJob extends SendJob { @Override public void onAdded() { - + SmsDatabase database = DatabaseFactory.getEncryptingSmsDatabase(context); + database.markAsSending(messageId); } @Override