Add internal pre-alpha support for receiving reactions.

This commit is contained in:
Alex Hart
2019-12-03 17:57:21 -04:00
committed by Greyson Parrelli
parent a8d826020d
commit bceb69b284
105 changed files with 3202 additions and 255 deletions

View File

@@ -51,7 +51,6 @@ import org.thoughtcrime.securesms.util.TextSecurePreferences;
import java.io.File;
import java.util.List;
import java.util.UUID;
public class SQLCipherOpenHelper extends SQLiteOpenHelper {
@@ -93,8 +92,10 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
private static final int ATTACHMENT_CLEAR_HASHES_2 = 34;
private static final int UUIDS = 35;
private static final int USERNAMES = 36;
private static final int REACTIONS = 37;
private static final int DATABASE_VERSION = 37;
private static final int DATABASE_VERSION = 36;
private static final String DATABASE_NAME = "signal.db";
private final Context context;
@@ -626,6 +627,17 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
db.execSQL("CREATE UNIQUE INDEX IF NOT EXISTS recipient_username_index ON recipient (username)");
}
if (oldVersion < REACTIONS) {
db.execSQL("ALTER TABLE sms ADD COLUMN reactions BLOB DEFAULT NULL");
db.execSQL("ALTER TABLE mms ADD COLUMN reactions BLOB DEFAULT NULL");
db.execSQL("ALTER TABLE sms ADD COLUMN reactions_unread INTEGER DEFAULT 0");
db.execSQL("ALTER TABLE mms ADD COLUMN reactions_unread INTEGER DEFAULT 0");
db.execSQL("ALTER TABLE sms ADD COLUMN reactions_last_seen INTEGER DEFAULT -1");
db.execSQL("ALTER TABLE mms ADD COLUMN reactions_last_seen INTEGER DEFAULT -1");
}
db.setTransactionSuccessful();
} finally {
db.endTransaction();