mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-12-12 07:37:35 +00:00
best-match: Use the country code
This commit is contained in:
parent
e5832bbad3
commit
622827d293
1 changed files with 6 additions and 5 deletions
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include "calls-best-match.h"
|
#include "calls-best-match.h"
|
||||||
#include "calls-contacts-provider.h"
|
#include "calls-contacts-provider.h"
|
||||||
|
#include "calls-manager.h"
|
||||||
#include "calls-vala.h"
|
#include "calls-vala.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
@ -273,6 +274,7 @@ calls_best_match_set_phone_number (CallsBestMatch *self,
|
||||||
g_autoptr (EPhoneNumber) number = NULL;
|
g_autoptr (EPhoneNumber) number = NULL;
|
||||||
g_autoptr (CallsPhoneNumberQuery) query = NULL;
|
g_autoptr (CallsPhoneNumberQuery) query = NULL;
|
||||||
g_autoptr (GError) error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
|
g_autofree gchar *country_code = NULL;
|
||||||
|
|
||||||
g_return_if_fail (CALLS_IS_BEST_MATCH (self));
|
g_return_if_fail (CALLS_IS_BEST_MATCH (self));
|
||||||
|
|
||||||
|
@ -289,11 +291,10 @@ calls_best_match_set_phone_number (CallsBestMatch *self,
|
||||||
g_clear_object (&self->view);
|
g_clear_object (&self->view);
|
||||||
|
|
||||||
if (self->phone_number) {
|
if (self->phone_number) {
|
||||||
/* FIXME: parsing the phone number can add the wrong country code if the default region
|
g_object_get (calls_manager_get_default (),
|
||||||
* for the app isn't set correctly.See:
|
"country-code", &country_code,
|
||||||
* https://developer.gnome.org/eds/stable/eds-e-phone-number.html#e-phone-number-get-default-region
|
NULL);
|
||||||
*/
|
number = e_phone_number_from_string (phone_number, country_code, &error);
|
||||||
number = e_phone_number_from_string (phone_number, NULL, &error);
|
|
||||||
|
|
||||||
if (!number) {
|
if (!number) {
|
||||||
g_warning ("Failed to convert %s to a phone number: %s", phone_number, error->message);
|
g_warning ("Failed to convert %s to a phone number: %s", phone_number, error->message);
|
||||||
|
|
Loading…
Reference in a new issue