summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
Diffstat (limited to 'program')
-rw-r--r--program/js/app.js3
-rw-r--r--program/steps/addressbook/save.inc14
2 files changed, 11 insertions, 6 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 29a53bb26..c792bb64b 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -4774,6 +4774,9 @@ function rcube_webmail()
if (!src)
src = this.env.source;
+ if (refresh)
+ group = this.env.group;
+
if (page && this.current_page == page && src == this.env.source && group == this.env.group)
return false;
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']);
+ }
}
}