mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-10 08:18:34 +00:00
Clear cached self id on successful registration.
This commit is contained in:
parent
4b5b9fbde8
commit
92e97e61c1
@ -129,6 +129,11 @@ public final class LiveRecipientCache {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AnyThread
|
||||||
|
public synchronized void clearSelf() {
|
||||||
|
localRecipientId = null;
|
||||||
|
}
|
||||||
|
|
||||||
@AnyThread
|
@AnyThread
|
||||||
public synchronized void clear() {
|
public synchronized void clear() {
|
||||||
recipients.clear();
|
recipients.clear();
|
||||||
|
@ -186,12 +186,14 @@ public final class CodeVerificationRequest {
|
|||||||
|
|
||||||
TextSecurePreferences.setLocalNumber(context, credentials.getE164number());
|
TextSecurePreferences.setLocalNumber(context, credentials.getE164number());
|
||||||
TextSecurePreferences.setLocalUuid(context, uuid);
|
TextSecurePreferences.setLocalUuid(context, uuid);
|
||||||
|
ApplicationDependencies.getRecipientCache().clearSelf();
|
||||||
|
|
||||||
TextSecurePreferences.setFcmToken(context, fcmToken);
|
TextSecurePreferences.setFcmToken(context, fcmToken);
|
||||||
TextSecurePreferences.setFcmDisabled(context, !present);
|
TextSecurePreferences.setFcmDisabled(context, !present);
|
||||||
TextSecurePreferences.setWebsocketRegistered(context, true);
|
TextSecurePreferences.setWebsocketRegistered(context, true);
|
||||||
|
|
||||||
DatabaseFactory.getIdentityDatabase(context)
|
DatabaseFactory.getIdentityDatabase(context)
|
||||||
.saveIdentity(Recipient.self().getId(),
|
.saveIdentity(selfId,
|
||||||
identityKey.getPublicKey(), IdentityDatabase.VerifiedStatus.VERIFIED,
|
identityKey.getPublicKey(), IdentityDatabase.VerifiedStatus.VERIFIED,
|
||||||
true, System.currentTimeMillis(), true);
|
true, System.currentTimeMillis(), true);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user