summaryrefslogtreecommitdiff
path: root/program/steps/addressbook/save.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-01-29 14:55:12 +0000
committerthomascube <thomas@roundcube.net>2011-01-29 14:55:12 +0000
commit98cb0f179206843ceaa87df6bfb3d1da045ed8ad (patch)
treeade6196094997c24b48e8a432383bd2da9f6bc5c /program/steps/addressbook/save.inc
parenta32679e69f7d6c265f85015677743272740dcc8e (diff)
Apply bug fixes and localization updated from trunk for release 0.5.1
Diffstat (limited to 'program/steps/addressbook/save.inc')
-rw-r--r--program/steps/addressbook/save.inc12
1 files changed, 12 insertions, 0 deletions
diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc
index f074f18a4..1c70b89b6 100644
--- a/program/steps/addressbook/save.inc
+++ b/program/steps/addressbook/save.inc
@@ -121,6 +121,18 @@ else {
if ($insert_id) {
+ // add new contact to the specified group
+ if ($CONTACTS->group_id) {
+ $plugin = $RCMAIL->plugins->exec_hook('group_addmembers', array('group_id' => $CONTACTS->group_id, 'ids' => $insert_id, 'source' => $source));
+
+ if (!$plugin['abort']) {
+ if (($maxnum = $RCMAIL->config->get('max_group_members', 0)) && ($CONTACTS->count()->count + 1 > $maxnum))
+ $OUTPUT->show_message('maxgroupmembersreached', 'warning', array('max' => $maxnum));
+
+ $CONTACTS->add_to_group($gid, $plugin['ids']);
+ }
+ }
+
// add contact row or jump to the page where it should appear
$CONTACTS->reset();
$result = $CONTACTS->search($CONTACTS->primary_key, $insert_id);