Update message details activity display when resending SMS/MMS

// FREEBIE
This commit is contained in:
Moxie Marlinspike 2015-03-13 11:29:44 -07:00
parent dee2e0906e
commit cc65fab226
3 changed files with 7 additions and 2 deletions

View File

@ -109,12 +109,14 @@ public class MessageRecipientListItem extends RelativeLayout
}); });
} else if (networkFailure != null || (!isPushGroup && record.isFailed())) { } else if (networkFailure != null || (!isPushGroup && record.isFailed())) {
resendButton.setVisibility(View.VISIBLE); resendButton.setVisibility(View.VISIBLE);
resendButton.setEnabled(true);
conflictButton.setVisibility(View.GONE); conflictButton.setVisibility(View.GONE);
errorText = getContext().getString(R.string.MessageDetailsRecipient_failed_to_send); errorText = getContext().getString(R.string.MessageDetailsRecipient_failed_to_send);
resendButton.setOnClickListener(new OnClickListener() { resendButton.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
resendButton.setEnabled(false);
new ResendAsyncTask(masterSecret, record, networkFailure).execute(); new ResendAsyncTask(masterSecret, record, networkFailure).execute();
} }
}); });

View File

@ -54,7 +54,8 @@ public class MmsSendJob extends SendJob {
@Override @Override
public void onAdded() { public void onAdded() {
MmsDatabase database = DatabaseFactory.getMmsDatabase(context);
database.markAsSending(messageId);
} }
@Override @Override

View File

@ -11,6 +11,7 @@ import org.thoughtcrime.securesms.crypto.MasterSecret;
import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.database.EncryptingSmsDatabase; import org.thoughtcrime.securesms.database.EncryptingSmsDatabase;
import org.thoughtcrime.securesms.database.NoSuchMessageException; import org.thoughtcrime.securesms.database.NoSuchMessageException;
import org.thoughtcrime.securesms.database.SmsDatabase;
import org.thoughtcrime.securesms.database.model.SmsMessageRecord; import org.thoughtcrime.securesms.database.model.SmsMessageRecord;
import org.thoughtcrime.securesms.jobs.requirements.MasterSecretRequirement; import org.thoughtcrime.securesms.jobs.requirements.MasterSecretRequirement;
import org.thoughtcrime.securesms.jobs.requirements.NetworkOrServiceRequirement; import org.thoughtcrime.securesms.jobs.requirements.NetworkOrServiceRequirement;
@ -39,7 +40,8 @@ public class SmsSendJob extends SendJob {
@Override @Override
public void onAdded() { public void onAdded() {
SmsDatabase database = DatabaseFactory.getEncryptingSmsDatabase(context);
database.markAsSending(messageId);
} }
@Override @Override