aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook/e-card.c
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/backend/ebook/e-card.c')
-rw-r--r--addressbook/backend/ebook/e-card.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index 3833211637..4b85c33868 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -1813,6 +1813,29 @@ e_card_email_match_string (const ECard *card, const gchar *str)
return FALSE;
}
+gint
+e_card_email_find_number (const ECard *card, const gchar *email)
+{
+ EIterator *iter;
+ gint count = 0;
+
+ g_return_val_if_fail (E_IS_CARD (card), -1);
+ g_return_val_if_fail (email != NULL, -1);
+
+ iter = e_list_get_iterator (card->email);
+ for (e_iterator_reset (iter); e_iterator_is_valid (iter); e_iterator_next (iter)) {
+ if (!strcmp (e_iterator_get (iter), email))
+ goto finished;
+ ++count;
+ }
+ count = -1;
+
+ finished:
+ gtk_object_unref (GTK_OBJECT (iter));
+
+ return count;
+}
+
/*
* ECard lifecycle management and vCard loading/saving.
*/