summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/mail
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-10-10 20:15:46 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-10-10 20:15:46 +0000
commit4dc279dae5fb66d8210a80c5f7f748b7df86cee9 (patch)
tree2ef14884c8184e8bfe9d9919c7df959cca4d1b04 /roundcubemail/program/steps/mail
parent77a043ad524b982dd05ed54343b2361a25829a9b (diff)
Contact groups can have direct email addresses => distribution lists; enable 'compose' command for the selected group
git-svn-id: https://svn.roundcube.net/trunk@5328 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail')
-rw-r--r--roundcubemail/program/steps/mail/autocomplete.inc13
1 files changed, 11 insertions, 2 deletions
diff --git a/roundcubemail/program/steps/mail/autocomplete.inc b/roundcubemail/program/steps/mail/autocomplete.inc
index bbc7734e2..5b935ad2c 100644
--- a/roundcubemail/program/steps/mail/autocomplete.inc
+++ b/roundcubemail/program/steps/mail/autocomplete.inc
@@ -85,9 +85,18 @@ if (!empty($book_types) && strlen($search)) {
foreach ($abook->list_groups($search) as $group) {
$abook->reset();
$abook->set_group($group['ID']);
- $result = $abook->count();
+ $group_prop = $abook->get_group($group['ID']);
- if ($result->count) {
+ // group (distribution list) with email address(es)
+ if ($group_prop['email']) {
+ foreach ((array)$group_prop['email'] as $email) {
+ $contacts[] = format_email_recipient($email, $group['name']);
+ if (count($contacts) >= $MAXNUM)
+ break 2;
+ }
+ }
+ // show group with count
+ else if (($result = $abook->count()) && $result->count) {
$contacts[] = array('name' => $group['name'] . ' (' . intval($result->count) . ')', 'id' => $group['ID'], 'source' => $id);
if (count($contacts) >= $MAXNUM)
break;