Skip to content

Be less restrictive when parsing tel: uris and don't add country code

Julian Sparber requested to merge julian.sparber/calls:relex_tel into master

e_phone_number_from_string () adds the default country code to phone numbers when they don't have any. The default country code depends on the current setup of the LC_ADDRESS category. See the docs for more details: https://developer.gnome.org/eds/unstable/eds-e-phone-number.html#e-phone-number-from-string

There isn't any need to add the country code to phone numbers, since mobile providers will handle it as a national call. By adding any country code to the user provided phone number will result most of the time create a number the user didn't try to call.

In addition to the above the e_phone_number_from_string () is quite restrictive when parsing phone numbers and rejects numbers which could be parsed correctly. Therefore this adds a new function for formatting the phone number which is based on the code in folks.

Fixes: #106

Related: https://source.puri.sm/Librem5/gnome-contacts/merge_requests/38

Edited by Julian Sparber

Merge request reports