summaryrefslogtreecommitdiff
path: root/plugins/tasklist
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-11-06 14:14:44 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-11-06 16:09:59 (GMT)
commit7294ef8be0594ec32476ba49a34282675919f38b (patch)
tree0df79e580221fbff482c1dd2c370b440ffabceae /plugins/tasklist
parentf01a600af44057dc2310c8df3982da35ec1d8252 (diff)
downloadroundcubemail-plugins-kolab-7294ef8be0594ec32476ba49a34282675919f38b.tar.gz
Send delegate attendee in iTip reply (as suggested in RFC 5546) + add it to organizers calendar/tasklist
Diffstat (limited to 'plugins/tasklist')
-rw-r--r--plugins/tasklist/localization/en_US.inc1
-rw-r--r--plugins/tasklist/tasklist.php13
2 files changed, 12 insertions, 2 deletions
diff --git a/plugins/tasklist/localization/en_US.inc b/plugins/tasklist/localization/en_US.inc
index 6874121..60ca18c 100644
--- a/plugins/tasklist/localization/en_US.inc
+++ b/plugins/tasklist/localization/en_US.inc
@@ -171,6 +171,7 @@ $labels['itipcommenttitle'] = 'This comment will be attached to the invitation/n
$labels['itipsendsuccess'] = 'Notification sent to assignees';
$labels['errornotifying'] = 'Failed to send notifications to task assignees';
$labels['removefromcalendar'] = 'Remove from my tasks';
+$labels['delegateinvitation'] = 'Delegate assignment';
$labels['andnmore'] = '$nr more...';
$labels['delegatedto'] = 'Delegated to: ';
diff --git a/plugins/tasklist/tasklist.php b/plugins/tasklist/tasklist.php
index 0ddba7d..71e6431 100644
--- a/plugins/tasklist/tasklist.php
+++ b/plugins/tasklist/tasklist.php
@@ -1806,10 +1806,11 @@ class tasklist extends rcube_plugin
if ($task['_method'] == 'REPLY') {
// try to identify the attendee using the email sender address
$existing_attendee = -1;
+ $existing_attendee_emails = array();
foreach ($existing['attendees'] as $i => $attendee) {
+ $existing_attendee_emails[] = $attendee['email'];
if ($task['_sender'] && ($attendee['email'] == $task['_sender'] || $attendee['email'] == $task['_sender_utf'])) {
$existing_attendee = $i;
- break;
}
}
@@ -1820,7 +1821,15 @@ class tasklist extends rcube_plugin
$metadata['fallback'] = $attendee['status'];
$metadata['attendee'] = $attendee['email'];
$metadata['rsvp'] = $attendee['rsvp'] || $attendee['role'] != 'NON-PARTICIPANT';
- break;
+ if ($attendee['status'] != 'DELEGATED') {
+ break;
+ }
+ }
+ // also copy delegate attendee
+ else if (!empty($attendee['delegated-from']) &&
+ (stripos($attendee['delegated-from'], $task['_sender']) !== false || stripos($attendee['delegated-from'], $task['_sender_utf']) !== false) &&
+ (!in_array($attendee['email'], $existing_attendee_emails))) {
+ $existing['attendees'][] = $attendee;
}
}