summaryrefslogtreecommitdiff
path: root/plugins/libcalendaring
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-11-06 16:09:49 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-11-06 16:09:59 (GMT)
commitc6f5a8233bf1a52841a7bfd2123e1d3f838413d8 (patch)
tree992a95b0ffb2a397e2a0aa2ce1d0ebe1e63e7eb6 /plugins/libcalendaring
parent7294ef8be0594ec32476ba49a34282675919f38b (diff)
downloadroundcubemail-plugins-kolab-c6f5a8233bf1a52841a7bfd2123e1d3f838413d8.tar.gz
Fix handling of RSVP flags
Diffstat (limited to 'plugins/libcalendaring')
-rw-r--r--plugins/libcalendaring/lib/libcalendaring_itip.php12
-rw-r--r--plugins/libcalendaring/libvcalendar.php3
2 files changed, 9 insertions, 6 deletions
diff --git a/plugins/libcalendaring/lib/libcalendaring_itip.php b/plugins/libcalendaring/lib/libcalendaring_itip.php
index 9524249..bd83f16 100644
--- a/plugins/libcalendaring/lib/libcalendaring_itip.php
+++ b/plugins/libcalendaring/lib/libcalendaring_itip.php
@@ -90,6 +90,7 @@ class libcalendaring_itip
* @param string Mail subject
* @param string Mail body text label
* @param object Mail_mime object with message data
+ * @param boolean Request RSVP
* @return boolean True on success, false on failure
*/
public function send_itip_message($event, $method, $recipient, $subject, $bodytext, $message = null, $rsvp = true)
@@ -98,7 +99,7 @@ class libcalendaring_itip
$this->sender['name'] = $this->sender['email'];
if (!$message)
- $message = $this->compose_itip_message($event, $method);
+ $message = $this->compose_itip_message($event, $method, $rsvp);
$mailto = rcube_idn_to_ascii($recipient['email']);
@@ -192,9 +193,10 @@ class libcalendaring_itip
*
* @param array Event object to send
* @param string iTip method (REQUEST|REPLY|CANCEL)
+ * @param boolean Request RSVP
* @return object Mail_mime object with message data
*/
- public function compose_itip_message($event, $method)
+ public function compose_itip_message($event, $method, $rsvp = true)
{
$from = rcube_idn_to_ascii($this->sender['email']);
$from_utf = rcube_utils::idn_to_utf8($from);
@@ -228,11 +230,11 @@ class libcalendaring_itip
$event['attendees'] = $reply_attendees;
}
}
- // set RSVP=TRUE for every attendee if not set
+ // set RSVP for every attendee
else if ($method == 'REQUEST') {
foreach ($event['attendees'] as $i => $attendee) {
- if (!isset($attendee['rsvp'])) {
- $event['attendees'][$i]['rsvp']= true;
+ if ($attendee['status'] != 'DELEGATED') {
+ $event['attendees'][$i]['rsvp']= $rsvp ? true : null;
}
}
}
diff --git a/plugins/libcalendaring/libvcalendar.php b/plugins/libcalendaring/libvcalendar.php
index 1e10ddc..062ee7e 100644
--- a/plugins/libcalendaring/libvcalendar.php
+++ b/plugins/libcalendaring/libvcalendar.php
@@ -1072,7 +1072,8 @@ class libvcalendar implements Iterator
$event['organizer'] = $attendee;
}
else if (!empty($attendee['email'])) {
- $attendee['rsvp'] = $attendee['rsvp'] ? 'TRUE' : null;
+ if (isset($attendee['rsvp']))
+ $attendee['rsvp'] = $attendee['rsvp'] ? 'TRUE' : 'FALSE';
$ve->add('ATTENDEE', 'mailto:' . $attendee['email'], array_filter(self::map_keys($attendee, $this->attendee_keymap)));
}
}