mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-06-17 18:11:03 +00:00
Clear verification sessionId after registration/changeNumber
Fixes #1882
This commit is contained in:
parent
ad2338b898
commit
fca4d7459c
@ -315,6 +315,7 @@ public class AccountHelper {
|
||||
Utils.mapKeys(pniRegistrationIds, Object::toString))));
|
||||
});
|
||||
|
||||
account.clearSessionId();
|
||||
final var updatePni = PNI.parseOrThrow(result.first().getPni());
|
||||
if (updatePni.equals(account.getPni())) {
|
||||
logger.debug("PNI is unchanged after change number");
|
||||
|
||||
@ -376,6 +376,7 @@ public class SignalAccount implements Closeable {
|
||||
trustSelfIdentity(ServiceIdType.ACI);
|
||||
trustSelfIdentity(ServiceIdType.PNI);
|
||||
getKeyValueStore().storeEntry(lastRecipientsRefresh, null);
|
||||
clearSessionId();
|
||||
}
|
||||
|
||||
public void initDatabase() {
|
||||
@ -1485,6 +1486,12 @@ public class SignalAccount implements Closeable {
|
||||
keyValueStore.storeEntry(verificationSessionId, sessionId);
|
||||
}
|
||||
|
||||
public void clearSessionId() {
|
||||
final var keyValueStore = getKeyValueStore();
|
||||
keyValueStore.storeEntry(verificationSessionNumber, null);
|
||||
keyValueStore.storeEntry(verificationSessionId, null);
|
||||
}
|
||||
|
||||
public void setEncryptedDeviceName(final String encryptedDeviceName) {
|
||||
this.encryptedDeviceName = encryptedDeviceName;
|
||||
save();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user