mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-19 03:50:45 +08:00
Revert "Fix WhatsApp connection test delivery without touching DSH sessions."
This reverts commit 0bc0992330.
This commit is contained in:
parent
0bc0992330
commit
dd2365407e
5 changed files with 206 additions and 396 deletions
|
|
@ -5,37 +5,11 @@ import {
|
|||
enrichWhatsappInboundIdentities,
|
||||
isWhatsappLidJid,
|
||||
rememberWhatsappLidPnPairs,
|
||||
resolveWhatsappSelfChatJid,
|
||||
stripWhatsappBotMentionText,
|
||||
whatsappBotMentionTokens,
|
||||
} from '../../../src/channels/whatsapp/whatsapp-identity.mjs';
|
||||
|
||||
describe('whatsapp-identity', () => {
|
||||
|
||||
it('resolves self-chat jid to live LID before stored PN', async () => {
|
||||
const accountJid = '8615601877957@s.whatsapp.net';
|
||||
const lid = '111222333444555@lid';
|
||||
assert.equal(await resolveWhatsappSelfChatJid({
|
||||
accountJid,
|
||||
socket: { user: { id: accountJid, lid } },
|
||||
}), lid);
|
||||
assert.equal(await resolveWhatsappSelfChatJid({
|
||||
accountJid,
|
||||
socket: {
|
||||
signalRepository: {
|
||||
lidMapping: {
|
||||
getLIDForPN: async (pn) => (pn === accountJid ? lid : null),
|
||||
},
|
||||
},
|
||||
},
|
||||
}), lid);
|
||||
assert.equal(await resolveWhatsappSelfChatJid({
|
||||
accountJid,
|
||||
lidPnCache: new Map([['111222333444555', accountJid]]),
|
||||
}), lid);
|
||||
assert.equal(await resolveWhatsappSelfChatJid({ accountJid }), accountJid);
|
||||
});
|
||||
|
||||
it('recognizes lid jids', () => {
|
||||
assert.equal(isWhatsappLidJid('91010910658657@lid'), true);
|
||||
assert.equal(isWhatsappLidJid('8618142387786@s.whatsapp.net'), false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue