diff --git a/src/calls-best-match.c b/src/calls-best-match.c index 12d8c89..e88d541 100644 --- a/src/calls-best-match.c +++ b/src/calls-best-match.c @@ -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) { diff --git a/src/calls-best-match.h b/src/calls-best-match.h index 0b5f034..562bf3b 100644 --- a/src/calls-best-match.h +++ b/src/calls-best-match.h @@ -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);