@@ -343,7 +343,7 @@ calls_best_match_set_phone_number (CallsBestMatch *self,
|
|||||||
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);
|
||||||
} else {
|
} else {
|
||||||
query = calls_phone_number_query_new (number);
|
query = calls_phone_number_query_new (number, self->country_code);
|
||||||
self->view = folks_search_view_new (folks_individual_aggregator_dup (), FOLKS_QUERY (query));
|
self->view = folks_search_view_new (folks_individual_aggregator_dup (), FOLKS_QUERY (query));
|
||||||
|
|
||||||
g_signal_connect_swapped (self->view,
|
g_signal_connect_swapped (self->view,
|
||||||
|
|||||||
@@ -26,8 +26,9 @@
|
|||||||
public class Calls.PhoneNumberQuery : Folks.Query
|
public class Calls.PhoneNumberQuery : Folks.Query
|
||||||
{
|
{
|
||||||
private E.PhoneNumber _number;
|
private E.PhoneNumber _number;
|
||||||
|
private string _country_code;
|
||||||
|
|
||||||
public PhoneNumberQuery (E.PhoneNumber number)
|
public PhoneNumberQuery (E.PhoneNumber number, string? country_code)
|
||||||
{
|
{
|
||||||
string[] match_fields =
|
string[] match_fields =
|
||||||
{ Folks.PersonaStore.detail_key (Folks.PersonaDetail.PHONE_NUMBERS) };
|
{ Folks.PersonaStore.detail_key (Folks.PersonaDetail.PHONE_NUMBERS) };
|
||||||
@@ -35,6 +36,7 @@ public class Calls.PhoneNumberQuery : Folks.Query
|
|||||||
Object (match_fields: match_fields);
|
Object (match_fields: match_fields);
|
||||||
|
|
||||||
this._number = number;
|
this._number = number;
|
||||||
|
this._country_code = country_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override uint is_match (Folks.Individual individual)
|
public override uint is_match (Folks.Individual individual)
|
||||||
@@ -56,7 +58,7 @@ public class Calls.PhoneNumberQuery : Folks.Query
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
indiv_parsed =
|
indiv_parsed =
|
||||||
E.PhoneNumber.from_string (indiv_number, null);
|
E.PhoneNumber.from_string (indiv_number, this._country_code);
|
||||||
}
|
}
|
||||||
catch (GLib.Error e)
|
catch (GLib.Error e)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user