mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-31 12:46:09 +00:00
Fix bug where SN change dialog appeared unnecessarily.
This commit is contained in:
committed by
Greyson Parrelli
parent
761de1318e
commit
5ced1a775c
@@ -180,7 +180,7 @@ public class IdentityDatabase extends Database {
|
||||
boolean statusMatches = keyMatches && hasMatchingStatus(id, identityKey, verifiedStatus);
|
||||
|
||||
if (!keyMatches || !statusMatches) {
|
||||
saveIdentityInternal(id, identityKey, verifiedStatus, false, System.currentTimeMillis(), true);
|
||||
saveIdentityInternal(id, identityKey, verifiedStatus, !hadEntry, System.currentTimeMillis(), true);
|
||||
Optional<IdentityRecord> record = getIdentity(id);
|
||||
if (record.isPresent()) EventBus.getDefault().post(record.get());
|
||||
}
|
||||
|
||||
@@ -56,8 +56,26 @@ public final class IdentityRecordList {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isUntrusted() {
|
||||
public boolean isUnverified(boolean excludeFirstUse) {
|
||||
for (IdentityRecord identityRecord : identityRecords) {
|
||||
if (excludeFirstUse && identityRecord.isFirstUse()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (identityRecord.getVerifiedStatus() == VerifiedStatus.UNVERIFIED) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isUntrusted(boolean excludeFirstUse) {
|
||||
for (IdentityRecord identityRecord : identityRecords) {
|
||||
if (excludeFirstUse && identityRecord.isFirstUse()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isUntrusted(identityRecord)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user