Populate incoming attachments with width and height from message

This commit is contained in:
Moxie Marlinspike
2018-03-18 16:04:33 -07:00
parent 3c30db7edf
commit 9f8b4cf892
16 changed files with 111 additions and 28 deletions

View File

@@ -42,8 +42,9 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
private static final int MIGRATE_PREKEYS_VERSION = 3;
private static final int MIGRATE_SESSIONS_VERSION = 4;
private static final int NO_MORE_IMAGE_THUMBNAILS_VERSION = 5;
private static final int ATTACHMENT_DIMENSIONS = 6;
private static final int DATABASE_VERSION = 4;
private static final int DATABASE_VERSION = 6;
private static final String DATABASE_NAME = "signal.db";
private final Context context;
@@ -161,6 +162,11 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
}
}
if (oldVersion < ATTACHMENT_DIMENSIONS) {
db.execSQL("ALTER TABLE part ADD COLUMN width INTEGER DEFAULT 0");
db.execSQL("ALTER TABLE part ADD COLUMN height INTEGER DEFAULT 0");
}
db.setTransactionSuccessful();
} finally {
db.endTransaction();