mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-09-21 06:19:41 +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))));
|
Utils.mapKeys(pniRegistrationIds, Object::toString))));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
account.clearSessionId();
|
||||||
final var updatePni = PNI.parseOrThrow(result.first().getPni());
|
final var updatePni = PNI.parseOrThrow(result.first().getPni());
|
||||||
if (updatePni.equals(account.getPni())) {
|
if (updatePni.equals(account.getPni())) {
|
||||||
logger.debug("PNI is unchanged after change number");
|
logger.debug("PNI is unchanged after change number");
|
||||||
|
|||||||
@ -376,6 +376,7 @@ public class SignalAccount implements Closeable {
|
|||||||
trustSelfIdentity(ServiceIdType.ACI);
|
trustSelfIdentity(ServiceIdType.ACI);
|
||||||
trustSelfIdentity(ServiceIdType.PNI);
|
trustSelfIdentity(ServiceIdType.PNI);
|
||||||
getKeyValueStore().storeEntry(lastRecipientsRefresh, null);
|
getKeyValueStore().storeEntry(lastRecipientsRefresh, null);
|
||||||
|
clearSessionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initDatabase() {
|
public void initDatabase() {
|
||||||
@ -1485,6 +1486,12 @@ public class SignalAccount implements Closeable {
|
|||||||
keyValueStore.storeEntry(verificationSessionId, sessionId);
|
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) {
|
public void setEncryptedDeviceName(final String encryptedDeviceName) {
|
||||||
this.encryptedDeviceName = encryptedDeviceName;
|
this.encryptedDeviceName = encryptedDeviceName;
|
||||||
save();
|
save();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user