1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-05-14 00:59:26 +00:00

best-match: Add API to query if individual is a favourite

This commit is contained in:
Evangelos Ribeiro Tzaras 2023-01-21 15:36:08 +01:00
parent d530c8bb0b
commit 55147aed97
2 changed files with 24 additions and 0 deletions

View file

@ -326,6 +326,29 @@ calls_best_match_has_individual (CallsBestMatch *self)
}
/**
* calls_best_match_is_favourite:
* @self: A #CallsBestMatch
*
* Returns: %TRUE if there's a matched individual and the individual is
* marked as a favourite, %FALSE otherwise.
*/
gboolean
calls_best_match_is_favourite (CallsBestMatch *self)
{
gboolean fav;
g_return_val_if_fail (CALLS_IS_BEST_MATCH (self), FALSE);
if (!self->matched_individual)
return FALSE;
g_object_get (G_OBJECT (self->matched_individual), "favourite", &fav, NULL);
return fav;
}
const char *
calls_best_match_get_phone_number (CallsBestMatch *self)
{

View file

@ -35,6 +35,7 @@ G_DECLARE_FINAL_TYPE (CallsBestMatch, calls_best_match, CALLS, BEST_MATCH, GObje
CallsBestMatch *calls_best_match_new (const char *phone_number);
gboolean calls_best_match_has_individual (CallsBestMatch *self);
gboolean calls_best_match_is_favourite (CallsBestMatch *self);
const char *calls_best_match_get_phone_number (CallsBestMatch *self);
void calls_best_match_set_phone_number (CallsBestMatch *self,
const char *phone_number);