Follow-up fixes for e164-less linking

This commit is contained in:
Fedor Indutny
2026-08-18 12:49:21 -07:00
committed by GitHub
parent 649e9e6fe4
commit 1e822478b0
3 changed files with 10 additions and 4 deletions
+2 -2
View File
@@ -1367,9 +1367,9 @@ async function showAbout() {
async function getIsLinked() {
try {
const number = await sql.sqlRead('getItemById', 'number_id');
const aci = await sql.sqlRead('getItemById', 'uuid_id');
const password = await sql.sqlRead('getItemById', 'password');
return Boolean(number && password);
return Boolean(aci && password);
} catch (e) {
return false;
}
+2 -2
View File
@@ -1015,8 +1015,8 @@ export type GetSenderCertificateResultType = Readonly<{ certificate: string }>;
const whoamiResultZod = z.object({
uuid: z.string(),
pni: untaggedPniSchema,
number: z.string(),
pni: untaggedPniSchema.nullish(),
number: z.string().nullish(),
usernameHash: z.string().nullish(),
usernameLinkHandle: z.string().nullish(),
});
@@ -17,6 +17,12 @@ export async function checkOurPniIdentityKey(): Promise<void> {
}
const { pni: remotePni } = await whoami();
if (remotePni == null) {
log.warn(`remote pni absent, local is ${ourPni}`);
window.Whisper.events.emit('unlinkAndDisconnect');
return;
}
if (toTaggedPni(remotePni) !== ourPni) {
log.warn(`remote pni mismatch, ${remotePni} != ${ourPni}`);
window.Whisper.events.emit('unlinkAndDisconnect');