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,7 +92,9 @@ public class PushTextSendJob extends PushSendJob implements InjectableType {
long threadId = DatabaseFactory.getSmsDatabase(context).getThreadIdForMessage(messageId);
Recipients recipients = DatabaseFactory.getThreadDatabase(context).getRecipientsForThreadId(threadId);
MessageNotifier.notifyMessageDeliveryFailed(context, recipients, threadId);
if (threadId != -1 && recipients != null) {
MessageNotifier.notifyMessageDeliveryFailed(context, recipients, threadId);
}
}
private void deliver(MasterSecret masterSecret, SmsMessageRecord message)