mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
Don't run integrity checks when unlinked
This commit is contained in:
+9
-1
@@ -1324,7 +1324,7 @@ export async function startApp(): Promise<void> {
|
|||||||
});
|
});
|
||||||
|
|
||||||
window.Whisper.events.on('unlinkAndDisconnect', () => {
|
window.Whisper.events.on('unlinkAndDisconnect', () => {
|
||||||
void unlinkAndDisconnect();
|
drop(unlinkAndDisconnect());
|
||||||
});
|
});
|
||||||
|
|
||||||
window.Whisper.events.on('httpResponse499', () => {
|
window.Whisper.events.on('httpResponse499', () => {
|
||||||
@@ -2928,6 +2928,14 @@ export async function startApp(): Promise<void> {
|
|||||||
conversation.unset('senderKeyInfo');
|
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
|
// Then make sure outstanding conversation saves are flushed
|
||||||
await window.Signal.Data.flushUpdateConversationBatcher();
|
await window.Signal.Data.flushUpdateConversationBatcher();
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
import pTimeout from 'p-timeout';
|
import pTimeout from 'p-timeout';
|
||||||
|
|
||||||
import * as Errors from '../types/errors';
|
import * as Errors from '../types/errors';
|
||||||
|
import { isDone as isRegistrationDone } from '../util/registration';
|
||||||
import { getConversation } from '../util/getConversation';
|
import { getConversation } from '../util/getConversation';
|
||||||
import { MINUTE, DAY } from '../util/durations';
|
import { MINUTE, DAY } from '../util/durations';
|
||||||
import { drop } from '../util/drop';
|
import { drop } from '../util/drop';
|
||||||
@@ -69,6 +70,10 @@ class UsernameIntegrityService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async check(): Promise<void> {
|
private async check(): Promise<void> {
|
||||||
|
if (!isRegistrationDone()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await this.checkUsername();
|
await this.checkUsername();
|
||||||
await this.checkPhoneNumberSharing();
|
await this.checkPhoneNumberSharing();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user