aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/itip-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/itip-utils.c')
-rw-r--r--calendar/gui/itip-utils.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index 4ab53de115..8c7c72f2f6 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -104,6 +104,33 @@ itip_get_user_identities (void)
}
/**
+ * itip_get_fallback_identity:
+ *
+ * Returns a name + address string taken from the default mail identity,
+ * but only if the corresponding account is enabled. If the account is
+ * disabled, the function returns %NULL. This is meant to be used as a
+ * fallback identity for organizers. Free the returned string with
+ * g_free().
+ *
+ * Returns: a fallback mail identity, or %NULL
+ **/
+gchar *
+itip_get_fallback_identity (void)
+{
+ EAccount *account;
+ gchar *identity = NULL;
+
+ account = e_get_default_account ();
+ if (account != NULL && account->enabled)
+ identity = g_strdup_printf (
+ "%s <%s>",
+ account->id->name,
+ account->id->address);
+
+ return identity;
+}
+
+/**
* itip_address_is_user:
* @address: an email address
*