Don't run integrity checks when unlinked
This commit is contained in:
parent
0f49d0d391
commit
79ed74f7b8
2 changed files with 14 additions and 1 deletions
|
@ -1324,7 +1324,7 @@ export async function startApp(): Promise<void> {
|
|||
});
|
||||
|
||||
window.Whisper.events.on('unlinkAndDisconnect', () => {
|
||||
void unlinkAndDisconnect();
|
||||
drop(unlinkAndDisconnect());
|
||||
});
|
||||
|
||||
window.Whisper.events.on('httpResponse499', () => {
|
||||
|
@ -2928,6 +2928,14 @@ export async function startApp(): Promise<void> {
|
|||
conversation.unset('senderKeyInfo');
|
||||
});
|
||||
|
||||
// We use username for integrity check
|
||||
const ourConversation =
|
||||
window.ConversationController.getOurConversation();
|
||||
if (ourConversation) {
|
||||
ourConversation.unset('username');
|
||||
window.Signal.Data.updateConversation(ourConversation.attributes);
|
||||
}
|
||||
|
||||
// Then make sure outstanding conversation saves are flushed
|
||||
await window.Signal.Data.flushUpdateConversationBatcher();
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
import pTimeout from 'p-timeout';
|
||||
|
||||
import * as Errors from '../types/errors';
|
||||
import { isDone as isRegistrationDone } from '../util/registration';
|
||||
import { getConversation } from '../util/getConversation';
|
||||
import { MINUTE, DAY } from '../util/durations';
|
||||
import { drop } from '../util/drop';
|
||||
|
@ -69,6 +70,10 @@ class UsernameIntegrityService {
|
|||
}
|
||||
|
||||
private async check(): Promise<void> {
|
||||
if (!isRegistrationDone()) {
|
||||
return;
|
||||
}
|
||||
|
||||
await this.checkUsername();
|
||||
await this.checkPhoneNumberSharing();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue