From 52e3b9950a6a65ad21d57f33111b0f6f0b694261 Mon Sep 17 00:00:00 2001 From: Max Kovaljov Date: Tue, 27 Aug 2013 14:11:57 +0200 Subject: [PATCH] Fixed detected CC for North America --- WhatsAppApi/Parser/PhoneNumber.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/WhatsAppApi/Parser/PhoneNumber.cs b/WhatsAppApi/Parser/PhoneNumber.cs index 5f19ab9..d73083f 100644 --- a/WhatsAppApi/Parser/PhoneNumber.cs +++ b/WhatsAppApi/Parser/PhoneNumber.cs @@ -39,6 +39,11 @@ public PhoneNumber(string number) { //matched this.Country = values[0].Trim(new char[] { '"' }); + //hook: Fix CC for North America + if (values[1].StartsWith("1")) + { + values[1] = "1"; + } this.CC = values[1]; this.Number = number.Substring(this.CC.Length); this.ISO3166 = values[3].Trim(new char[] { '"' });