Aleksander Machniak
2014-07-05 43e9fc9499c54c7505acdcc780316fc54f037567
Skip redundant get_group() call for better performance of listing groups in compose addressbook
1 files modified
7 ■■■■■ changed files
program/steps/mail/func.inc 7 ●●●●● patch | view | raw | blame | history
program/steps/mail/func.inc
@@ -2112,11 +2112,10 @@
    foreach ($abook->list_groups($search, $search_mode) as $group) {
        $abook->reset();
        $abook->set_group($group['ID']);
        $group_prop = $abook->get_group($group['ID']);
        // group (distribution list) with email address(es)
        if ($group_prop['email']) {
            foreach ((array)$group_prop['email'] as $email) {
        if ($group['email']) {
            foreach ((array)$group['email'] as $email) {
                $row_id = 'G'.$group['ID'];
                $jsresult[$row_id] = format_email_recipient($email, $group['name']);
                $OUTPUT->command('add_contact_row', $row_id, array(
@@ -2124,7 +2123,7 @@
            }
        }
        // make virtual groups clickable to list their members
        else if ($group_prop['virtual']) {
        else if ($group['virtual']) {
            $row_id = 'G'.$group['ID'];
            $OUTPUT->command('add_contact_row', $row_id, array(
                'contactgroup' => html::a(array(