Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarBasem committed Mar 27, 2021
1 parent 36586d8 commit 046a4d8
Showing 1 changed file with 26 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,33 +81,35 @@ public boolean saveIdentity(SignalProtocolAddress address, IdentityKey identityK
Log.d("NEW", "Saving new identity...");
identityDatabase.saveIdentity(recipient.getId(), identityKey, VerifiedStatus.DEFAULT, true, System.currentTimeMillis(), nonBlockingApproval);
return false;
}

if (!identityRecord.get().getIdentityKey().equals(identityKey)) {
Log.d("REPLACING", "Replacing existing identity...");
VerifiedStatus verifiedStatus;

if (identityRecord.get().getVerifiedStatus() == VerifiedStatus.VERIFIED ||
identityRecord.get().getVerifiedStatus() == VerifiedStatus.UNVERIFIED)
{
verifiedStatus = VerifiedStatus.UNVERIFIED;
} else {
verifiedStatus = VerifiedStatus.DEFAULT;
}

identityDatabase.saveIdentity(recipient.getId(), identityKey, verifiedStatus, false, System.currentTimeMillis(), nonBlockingApproval);
Log.d("ARHIVINGGG", "ARHIVIING");
SessionUtil.archiveSiblingSessions(context, address);
} else {
return true;
}

if (isNonBlockingApprovalRequired(identityRecord.get())) {
Log.i("SETTING", "Setting approval status...");
identityDatabase.setApproval(recipient.getId(), nonBlockingApproval);
return false;
}

return false;
// if (!identityRecord.get().getIdentityKey().equals(identityKey)) {
// Log.d("REPLACING", "Replacing existing identity...");
// VerifiedStatus verifiedStatus;
//
// if (identityRecord.get().getVerifiedStatus() == VerifiedStatus.VERIFIED ||
// identityRecord.get().getVerifiedStatus() == VerifiedStatus.UNVERIFIED)
// {
// verifiedStatus = VerifiedStatus.UNVERIFIED;
// } else {
// verifiedStatus = VerifiedStatus.DEFAULT;
// }
//
// identityDatabase.saveIdentity(recipient.getId(), identityKey, verifiedStatus, false, System.currentTimeMillis(), nonBlockingApproval);
// Log.d("ARHIVINGGG", "ARHIVIING");
// SessionUtil.archiveSiblingSessions(context, address);
// return true;
// }

// if (isNonBlockingApprovalRequired(identityRecord.get())) {
// Log.i("SETTING", "Setting approval status...");
// identityDatabase.setApproval(recipient.getId(), nonBlockingApproval);
// return false;
// }

// return false;
}
}

Expand Down

0 comments on commit 046a4d8

Please sign in to comment.