Fix migration issue

pull/373/head 1.6.2
nielsandriesse 4 years ago
parent ced392a555
commit c8f7d788b9

@ -465,11 +465,11 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
String groupId = GroupUtil.getEncodedOpenGroupId(publicChat.getId().getBytes());
publicChatAPI.updateProfileIfNeeded(
publicChat.getChannel(),
publicChat.getServer(),
groupId,
info,
false);
publicChat.getChannel(),
publicChat.getServer(),
groupId,
info,
false);
runOnUiThread(ConversationActivity.this::updateSubtitleTextView);
return Unit.INSTANCE;

@ -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…
Cancel
Save