Add phone number lookup using libfolks

The CallsBestMatchView and CallsPhoneNumberQuery classes are written
in Vala because they may be generally useful and to leave open the
possibility of adding them to libfolks itself, which is written in
Vala.
This commit is contained in:
Bob Ham
2019-10-28 10:21:09 +00:00
parent 4b4cfa0426
commit 6a7fbf0b59
8 changed files with 426 additions and 9 deletions

View File

@@ -0,0 +1,49 @@
/*
* Copyright (C) 2019 Purism SPC
*
* This file is part of Calls.
*
* Calls is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calls is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calls. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Bob Ham <bob.ham@puri.sm>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
public class Calls.BestMatchView : Folks.SearchView
{
public Folks.Individual? best_match
{
get;
private set;
}
private void update ()
{
best_match =
individuals.is_empty ? null : individuals.first ();
}
public BestMatchView (Folks.IndividualAggregator aggregator,
Folks.Query query)
{
base (aggregator, query);
this.individuals_changed_detailed.connect
((sv, p) => { update (); });
update();
}
}