From 692011df7fbba1c096802922da99a6c8a883d556 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 27 Nov 2014 06:24:42 -0500 Subject: Extend list_emails() to optionally return only default identity --- program/lib/Roundcube/rcube_user.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'program') diff --git a/program/lib/Roundcube/rcube_user.php b/program/lib/Roundcube/rcube_user.php index 68156b157..77c58dd14 100644 --- a/program/lib/Roundcube/rcube_user.php +++ b/program/lib/Roundcube/rcube_user.php @@ -240,9 +240,11 @@ class rcube_user /** * Return a list of all user emails (from identities) * + * @param bool Return only default identity + * * @return array List of emails (identity_id, name, email) */ - function list_emails() + function list_emails($default = false) { if ($this->emails === null) { $this->emails = array(); @@ -259,7 +261,7 @@ class rcube_user } } - return $this->emails; + return $default ? $this->emails[0] : $this->emails; } /** -- cgit v1.2.3