diff options
Diffstat (limited to 'program/steps/addressbook/save.inc')
-rw-r--r-- | program/steps/addressbook/save.inc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc index 4f30fd4b7..518625cb5 100644 --- a/program/steps/addressbook/save.inc +++ b/program/steps/addressbook/save.inc @@ -226,13 +226,15 @@ else { $plugin = $RCMAIL->plugins->exec_hook('group_addmembers', array( 'group_id' => $CONTACTS->group_id, 'ids' => $insert_id, 'source' => $source)); - $counts = $CONTACTS->count(); - if (!$plugin['abort']) { - if (($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($counts->count + 1 > $maxnum)) - $OUTPUT->show_message('maxgroupmembersreached', 'warning', array('max' => $maxnum)); - - $CONTACTS->add_to_group($plugin['group_id'], $plugin['ids']); + if (($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($CONTACTS->count()->count + 1 > $maxnum)) { + // @FIXME: should we remove the contact? + $msgtext = $RCMAIL->gettext(array('name' => 'maxgroupmembersreached', 'vars' => array('max' => $maxnum))); + $OUTPUT->command('parent.display_message', $msgtext, 'warning'); + } + else { + $CONTACTS->add_to_group($plugin['group_id'], $plugin['ids']); + } } } |