Compare commits

...
2 Commits
Author SHA1 Message Date
devlikepro 8fbf7fa0e5 [core] ChatWoot - brazil phone number
Release / WEBJS - chrome - amd64 - chrome (push) Waiting to run
Release / WEBJS - chromium - amd64 - latest (push) Waiting to run
Release / WEBJS - chromium - linux/arm64 - arm (push) Waiting to run
Release / GOWS - none - amd64 - gows (push) Waiting to run
Release / GOWS - none - linux/arm64 - gows-arm (push) Waiting to run
Release / NOWEB - none - amd64 - noweb (push) Waiting to run
Release / NOWEB - none - linux/arm64 - noweb-arm (push) Waiting to run
fix #1261
2025-09-29 12:10:09 +07:00
devlikepro af0bba313a [core] 2025.9.7 2025-09-29 12:10:09 +07:00
3 changed files with 14 additions and 10 deletions

No files matched your search

+11 -5
View File
@@ -12,19 +12,25 @@ describe('E164Parser.fromJid', () => {
expect(E164Parser.fromJid('@s.whatsapp.net')).toBeNull();
});
it('applies Brazil DDD + add-9 rule when local has 8 digits and not starting with 9', () => {
// +55 <DDD:2> <local:8> and local does not start with 9
it('applies Brazil add-9 rule when local has 8 digits (any first digit)', () => {
// +55 <DDD:2> <local:8>
expect(E164Parser.fromJid('553188888888@s.whatsapp.net')).toBe(
'+5531988888888',
);
});
it('does not add 9 when local already starts with 9 (Brazil)', () => {
it('554999111111 => 5549999111111', () => {
expect(E164Parser.fromJid('554999111111@s.whatsapp.net')).toBe(
'+5549999111111',
);
});
it('adds 9 even when local already starts with 9 (Brazil)', () => {
expect(E164Parser.fromJid('553198888888@s.whatsapp.net')).toBe(
'+553198888888',
'+5531998888888',
);
expect(E164Parser.fromJid('553199999999@s.whatsapp.net')).toBe(
'+553199999999',
'+5531999999999',
);
});
+2 -4
View File
@@ -53,12 +53,10 @@ export class PhoneJidNormalizer {
}
const RULES = [
// Brazil - add 9 before Direct Distance Dialing
// +55 <DDD:2> <local:8>, not already starting with 9
// +553188888888 => +5531988888888
// Brazil - ensure mobile numbers have 9 digits after DDD
{
name: 'br-add-9-after-ddd',
re: /^\+55(\d{2})(?!9)(\d{8})$/,
re: /^\+55(\d{2})(\d{8})$/,
replace: '+55$19$2',
},
];
+1 -1
View File
@@ -30,7 +30,7 @@ export function getWAHAVersion(): WAHAVersion {
}
export const VERSION: WAHAEnvironment = {
version: '2025.9.6',
version: '2025.9.7',
engine: getEngineName(),
tier: getWAHAVersion(),
browser: