Clear cached self id on successful registration.
This commit is contained in:
parent
4b5b9fbde8
commit
92e97e61c1
2 changed files with 8 additions and 1 deletions
|
@ -129,6 +129,11 @@ public final class LiveRecipientCache {
|
|||
});
|
||||
}
|
||||
|
||||
@AnyThread
|
||||
public synchronized void clearSelf() {
|
||||
localRecipientId = null;
|
||||
}
|
||||
|
||||
@AnyThread
|
||||
public synchronized void clear() {
|
||||
recipients.clear();
|
||||
|
|
|
@ -186,12 +186,14 @@ public final class CodeVerificationRequest {
|
|||
|
||||
TextSecurePreferences.setLocalNumber(context, credentials.getE164number());
|
||||
TextSecurePreferences.setLocalUuid(context, uuid);
|
||||
ApplicationDependencies.getRecipientCache().clearSelf();
|
||||
|
||||
TextSecurePreferences.setFcmToken(context, fcmToken);
|
||||
TextSecurePreferences.setFcmDisabled(context, !present);
|
||||
TextSecurePreferences.setWebsocketRegistered(context, true);
|
||||
|
||||
DatabaseFactory.getIdentityDatabase(context)
|
||||
.saveIdentity(Recipient.self().getId(),
|
||||
.saveIdentity(selfId,
|
||||
identityKey.getPublicKey(), IdentityDatabase.VerifiedStatus.VERIFIED,
|
||||
true, System.currentTimeMillis(), true);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue