summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-08-25 13:58:15 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-08-25 13:58:15 (GMT)
commit9496f4f820db1c5822e339033fe81f864b42ea47 (patch)
treec8685a518410785000a52fde4b209cacc8f2c064
parent8238c5ac8bf65baf50175b56b8d795d9a25944b4 (diff)
downloadroundcubemail-plugins-kolab-9496f4f820db1c5822e339033fe81f864b42ea47.tar.gz
-Don't append RSVP weblinks on information updates which don't require a response (#3446)
-rw-r--r--plugins/calendar/calendar.php3
-rw-r--r--plugins/libcalendaring/lib/libcalendaring_itip.php6
-rw-r--r--plugins/tasklist/tasklist.php3
3 files changed, 7 insertions, 5 deletions
diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index 4975f7c..36947ea 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -1800,13 +1800,14 @@ class calendar extends rcube_plugin
// which template to use for mail text
$is_new = !in_array($attendee['email'], $old_attendees);
+ $is_rsvp = $is_new || $event['sequence'] > $old['sequence'];
$bodytext = $is_cancelled ? 'eventcancelmailbody' : ($is_new ? 'invitationmailbody' : 'eventupdatemailbody');
$subject = $is_cancelled ? 'eventcancelsubject' : ($is_new ? 'invitationsubject' : ($event['title'] ? 'eventupdatesubject':'eventupdatesubjectempty'));
$event['comment'] = $comment;
// finally send the message
- if ($itip->send_itip_message($event, $method, $attendee, $subject, $bodytext, $message))
+ if ($itip->send_itip_message($event, $method, $attendee, $subject, $bodytext, $message, $is_rsvp))
$sent++;
else
$sent = -100;
diff --git a/plugins/libcalendaring/lib/libcalendaring_itip.php b/plugins/libcalendaring/lib/libcalendaring_itip.php
index 0b21ed8..6ff1229 100644
--- a/plugins/libcalendaring/lib/libcalendaring_itip.php
+++ b/plugins/libcalendaring/lib/libcalendaring_itip.php
@@ -92,7 +92,7 @@ class libcalendaring_itip
* @param object Mail_mime object with message data
* @return boolean True on success, false on failure
*/
- public function send_itip_message($event, $method, $recipient, $subject, $bodytext, $message = null)
+ public function send_itip_message($event, $method, $recipient, $subject, $bodytext, $message = null, $rsvp = true)
{
if (!$this->sender['name'])
$this->sender['name'] = $this->sender['email'];
@@ -125,7 +125,7 @@ class libcalendaring_itip
'vars' => array(
'title' => $event['title'],
'date' => $this->lib->event_date_text($event, true),
- 'attendees' => join(', ', $attendees_list),
+ 'attendees' => join(",\n ", $attendees_list),
'sender' => $this->sender['name'],
'organizer' => $this->sender['name'],
)
@@ -136,7 +136,7 @@ class libcalendaring_itip
// }
// append links for direct invitation replies
- if ($method == 'REQUEST' && ($token = $this->store_invitation($event, $recipient['email']))) {
+ if ($method == 'REQUEST' && $rsvp && ($token = $this->store_invitation($event, $recipient['email']))) {
$mailbody .= "\n\n" . $this->gettext(array(
'name' => 'invitationattendlinks',
'vars' => array('url' => $this->plugin->get_url(array('action' => 'attend', 't' => $token))),
diff --git a/plugins/tasklist/tasklist.php b/plugins/tasklist/tasklist.php
index c943f54..4004a9b 100644
--- a/plugins/tasklist/tasklist.php
+++ b/plugins/tasklist/tasklist.php
@@ -734,11 +734,12 @@ class tasklist extends rcube_plugin
// which template to use for mail text
$is_new = !in_array($attendee['email'], $old_attendees);
+ $is_rsvp = $is_new || $task['sequence'] > $old['sequence'];
$bodytext = $is_cancelled ? 'itipcancelmailbody' : ($is_new ? 'invitationmailbody' : 'itipupdatemailbody');
$subject = $is_cancelled ? 'itipcancelsubject' : ($is_new ? 'invitationsubject' : ($task['title'] ? 'itipupdatesubject' : 'itipupdatesubjectempty'));
// finally send the message
- if ($itip->send_itip_message($object, $method, $attendee, $subject, $bodytext, $message))
+ if ($itip->send_itip_message($object, $method, $attendee, $subject, $bodytext, $message, $is_rsvp))
$sent++;
else
$sent = -100;