Don't attempt send failure notifications for deleted messages.

Fixes #2963

// FREEBIE
This commit is contained in:
Moxie Marlinspike 2015-04-13 08:57:20 -07:00
parent b9541a65b0
commit 1c90b59bb8
2 changed files with 5 additions and 2 deletions

View File

@ -22,6 +22,7 @@ import android.database.Cursor;
import android.database.MergeCursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.util.Log;
@ -371,7 +372,7 @@ public class ThreadDatabase extends Database {
}
}
public Recipients getRecipientsForThreadId(long threadId) {
public @Nullable Recipients getRecipientsForThreadId(long threadId) {
SQLiteDatabase db = databaseHelper.getReadableDatabase();
Cursor cursor = null;

View File

@ -92,8 +92,10 @@ public class PushTextSendJob extends PushSendJob implements InjectableType {
long threadId = DatabaseFactory.getSmsDatabase(context).getThreadIdForMessage(messageId);
Recipients recipients = DatabaseFactory.getThreadDatabase(context).getRecipientsForThreadId(threadId);
if (threadId != -1 && recipients != null) {
MessageNotifier.notifyMessageDeliveryFailed(context, recipients, threadId);
}
}
private void deliver(MasterSecret masterSecret, SmsMessageRecord message)
throws UntrustedIdentityException, InsecureFallbackApprovalException, RetryLaterException