diff options
Diffstat (limited to 'calendar/gui/e-meeting-store.c')
-rw-r--r-- | calendar/gui/e-meeting-store.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c index c89bd44e2a..b0c658215c 100644 --- a/calendar/gui/e-meeting-store.c +++ b/calendar/gui/e-meeting-store.c @@ -35,6 +35,7 @@ #include <libedataserver/e-proxy.h> #include <libedataserverui/e-passwords.h> #include <e-util/e-extensible.h> +#include <e-util/e-account-utils.h> #include <e-util/e-util-enumtypes.h> #include "itip-utils.h" #include "e-meeting-utils.h" @@ -1086,6 +1087,52 @@ e_meeting_store_remove_all_attendees (EMeetingStore *store) } } +/** + * e_meeting_store_find_self: + * @store: an #EMeetingStore + * @row: return location for the matching row number, or %NULL + * + * Looks for the user in @store by comparing attendee email addresses to + * registered mail identities. If a matching email address is found and + * @row is not %NULL, @row will be set to the #EMeetingStore row number + * with the matching email address. + * + * Returns: an #EMeetingAttendee, or %NULL + **/ +EMeetingAttendee * +e_meeting_store_find_self (EMeetingStore *store, + gint *row) +{ + EMeetingAttendee *attendee = NULL; + EAccountList *account_list; + EIterator *iterator; + + g_return_val_if_fail (E_IS_MEETING_STORE (store), NULL); + + account_list = e_get_account_list (); + + iterator = e_list_get_iterator (E_LIST (account_list)); + + while (e_iterator_is_valid (iterator)) { + EAccount *account; + + /* XXX EIterator misuses const. */ + account = (EAccount *) e_iterator_get (iterator); + + attendee = e_meeting_store_find_attendee ( + store, account->id->address, row); + + if (attendee != NULL) + break; + + e_iterator_next (iterator); + } + + g_object_unref (iterator); + + return attendee; +} + EMeetingAttendee * e_meeting_store_find_attendee (EMeetingStore *store, const gchar *address, |