mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-07 12:25:31 +00:00
best-match: Add API to query if individual is a favourite
This commit is contained in:
parent
d530c8bb0b
commit
55147aed97
2 changed files with 24 additions and 0 deletions
|
@ -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 *
|
const char *
|
||||||
calls_best_match_get_phone_number (CallsBestMatch *self)
|
calls_best_match_get_phone_number (CallsBestMatch *self)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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);
|
CallsBestMatch *calls_best_match_new (const char *phone_number);
|
||||||
gboolean calls_best_match_has_individual (CallsBestMatch *self);
|
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);
|
const char *calls_best_match_get_phone_number (CallsBestMatch *self);
|
||||||
void calls_best_match_set_phone_number (CallsBestMatch *self,
|
void calls_best_match_set_phone_number (CallsBestMatch *self,
|
||||||
const char *phone_number);
|
const char *phone_number);
|
||||||
|
|
Loading…
Reference in a new issue