nyaruka / gocommon

Common utility library for the TextIt platform.
Other
7 stars 11 forks source link

Tel Parsing should deal with full tel URNs better #41

Open nicpottier opened 3 years ago

nicpottier commented 3 years ago

urns.NewTelURNForCountry("tel:+12065551212", "US") -> tel:+tel12065551212

Which seems mighty unfortunate considering how many people probably intuitively want to use @urns.tel as the argument to things that expect a telephone number.

Detecting we are given a tel URN seems like it would probably be worth it? What are possible downsides there?

Also feels super weird that the current behavior ends up with + prefixed on the returned number.

@rowanseymour feels liken number parsing this has been under a lot of flux lately, any opinions here?

rowanseymour commented 3 years ago

Yeah that seems reasonable - tel: afterall isn't just a RP pro thing. Where are we seeing this?

nicpottier commented 3 years ago

Just noticed it myself when writing a unit test and wanting to pass @contact.tel as a phone number. :)