Skip to content

Commit

Permalink
Fix migration issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsandriesse committed Oct 28, 2020
1 parent ced392a commit c8f7d78
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,11 @@ public void onSuccess(Boolean loadedDraft) {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -630,10 +631,13 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}

if (oldVersion < lokiV15) {
db.execSQL(LokiAPIDatabase.getCreateOpenGroupProfilePictureTableCommand());
db.execSQL(SharedSenderKeysDatabase.getCreateOldClosedGroupRatchetTableCommand());
}

if (oldVersion < lokiV16) {
db.execSQL(LokiAPIDatabase.getCreateOpenGroupProfilePictureTableCommand());
}

db.setTransactionSuccessful();
} finally {
db.endTransaction();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c8f7d78

Please sign in to comment.