best-match: Add API to query if individual is a favourite
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user