mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-26 07:37:08 +00:00
Cleanup some possible bad RecipientIds in the MMS table.
This commit is contained in:
@@ -85,8 +85,9 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
||||
private static final int ATTACHMENT_HASHING = 28;
|
||||
private static final int NOTIFICATION_RECIPIENT_IDS = 29;
|
||||
private static final int BLUR_HASH = 30;
|
||||
private static final int MMS_RECIPIENT_CLEANUP_2 = 31;
|
||||
|
||||
private static final int DATABASE_VERSION = 30;
|
||||
private static final int DATABASE_VERSION = 31;
|
||||
private static final String DATABASE_NAME = "signal.db";
|
||||
|
||||
private final Context context;
|
||||
@@ -589,6 +590,13 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
||||
db.execSQL("ALTER TABLE part ADD COLUMN blur_hash TEXT DEFAULT NULL");
|
||||
}
|
||||
|
||||
if (oldVersion < MMS_RECIPIENT_CLEANUP_2) {
|
||||
ContentValues values = new ContentValues(1);
|
||||
values.put("address", "-1");
|
||||
int count = db.update("mms", values, "address = ? OR address IS NULL", new String[] { "0" });
|
||||
Log.i(TAG, "MMS recipient cleanup 2 updated " + count + " rows.");
|
||||
}
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
|
||||
Reference in New Issue
Block a user