mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 10:03:39 +00:00
Fix migration issue
This commit is contained in:
parent
ced392a555
commit
c8f7d788b9
@ -92,8 +92,9 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
||||
private static final int lokiV13 = 34;
|
||||
private static final int lokiV14_BACKUP_FILES = 35;
|
||||
private static final int lokiV15 = 36;
|
||||
private static final int lokiV16 = 37;
|
||||
|
||||
private static final int DATABASE_VERSION = lokiV15;
|
||||
private static final int DATABASE_VERSION = lokiV16;
|
||||
private static final String DATABASE_NAME = "signal.db";
|
||||
|
||||
private final Context context;
|
||||
@ -630,10 +631,13 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
if (oldVersion < lokiV15) {
|
||||
db.execSQL(LokiAPIDatabase.getCreateOpenGroupProfilePictureTableCommand());
|
||||
db.execSQL(SharedSenderKeysDatabase.getCreateOldClosedGroupRatchetTableCommand());
|
||||
}
|
||||
|
||||
if (oldVersion < lokiV16) {
|
||||
db.execSQL(LokiAPIDatabase.getCreateOpenGroupProfilePictureTableCommand());
|
||||
}
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
|
@ -68,10 +68,10 @@ class ProfilePictureView : RelativeLayout {
|
||||
return result ?: publicKey
|
||||
}
|
||||
}
|
||||
fun isOpenGroupWithAvatar(recipient: Recipient): Boolean {
|
||||
fun isOpenGroupWithProfilePicture(recipient: Recipient): Boolean {
|
||||
return recipient.isOpenGroupRecipient && recipient.groupAvatarId != null
|
||||
}
|
||||
if (recipient.isGroupRecipient && !isOpenGroupWithAvatar(recipient)) {
|
||||
if (recipient.isGroupRecipient && !isOpenGroupWithProfilePicture(recipient)) {
|
||||
val users = MentionsManager.shared.userPublicKeyCache[threadID]?.toMutableList() ?: mutableListOf()
|
||||
users.remove(TextSecurePreferences.getLocalNumber(context))
|
||||
val masterPublicKey = TextSecurePreferences.getMasterHexEncodedPublicKey(context)
|
||||
|
Loading…
x
Reference in New Issue
Block a user