summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2022-12-13 22:04:44 +0100
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-12-22 09:14:36 +0000
commit8c2692557f8d00ff9329ffac4db524eccc0d7090 (patch)
tree0540ff18f2a31088734d1ce0181c0f5fa701d743
parent51e3de32d64102947e9e12db2c15b2a2caa87776 (diff)
downloadnextcloud-server-8c2692557f8d00ff9329ffac4db524eccc0d7090.tar.gz
nextcloud-server-8c2692557f8d00ff9329ffac4db524eccc0d7090.zip
Remove comment and guests option from Invitations UI
Signed-off-by: Anna Larch <anna@nextcloud.com>
-rw-r--r--apps/dav/lib/Controller/InvitationResponseController.php19
-rw-r--r--apps/dav/templates/schedule-response-options.php4
-rw-r--r--apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php14
3 files changed, 4 insertions, 33 deletions
diff --git a/apps/dav/lib/Controller/InvitationResponseController.php b/apps/dav/lib/Controller/InvitationResponseController.php
index de22e3ba6a9..a3607949874 100644
--- a/apps/dav/lib/Controller/InvitationResponseController.php
+++ b/apps/dav/lib/Controller/InvitationResponseController.php
@@ -140,15 +140,13 @@ class InvitationResponseController extends Controller {
*/
public function processMoreOptionsResult(string $token):TemplateResponse {
$partstat = $this->request->getParam('partStat');
- $guests = (int) $this->request->getParam('guests');
- $comment = $this->request->getParam('comment');
$row = $this->getTokenInformation($token);
if (!$row || !\in_array($partstat, ['ACCEPTED', 'DECLINED', 'TENTATIVE'])) {
return new TemplateResponse($this->appName, 'schedule-response-error', [], 'guest');
}
- $iTipMessage = $this->buildITipResponse($row, $partstat, $guests, $comment);
+ $iTipMessage = $this->buildITipResponse($row, $partstat);
$this->responseServer->handleITipMessage($iTipMessage);
if ($iTipMessage->getScheduleStatus() === '1.2') {
return new TemplateResponse($this->appName, 'schedule-response-success', [], 'guest');
@@ -190,8 +188,7 @@ class InvitationResponseController extends Controller {
* @param string|null $comment
* @return Message
*/
- private function buildITipResponse(array $row, string $partStat, int $guests = null,
- string $comment = null):Message {
+ private function buildITipResponse(array $row, string $partStat):Message {
$iTipMessage = new Message();
$iTipMessage->uid = $row['uid'];
$iTipMessage->component = 'VEVENT';
@@ -225,19 +222,7 @@ EOF;
$row['uid'], $row['sequence'] ?? 0, $row['recurrenceid'] ?? ''
]));
$vEvent = $vObject->{'VEVENT'};
- /** @var \Sabre\VObject\Property\ICalendar\CalAddress $attendee */
- $attendee = $vEvent->{'ATTENDEE'};
-
$vEvent->DTSTAMP = date('Ymd\\THis\\Z', $this->timeFactory->getTime());
-
- if ($comment) {
- $attendee->add('X-RESPONSE-COMMENT', $comment);
- $vEvent->add('COMMENT', $comment);
- }
- if ($guests) {
- $attendee->add('X-NUM-GUESTS', $guests);
- }
-
$iTipMessage->message = $vObject;
return $iTipMessage;
diff --git a/apps/dav/templates/schedule-response-options.php b/apps/dav/templates/schedule-response-options.php
index fe12ea96c79..bae43022f12 100644
--- a/apps/dav/templates/schedule-response-options.php
+++ b/apps/dav/templates/schedule-response-options.php
@@ -25,10 +25,6 @@
</label>
</div>
</fieldset>
- <fieldset id="more_options">
- <input type="number" min="0" name="guests" placeholder="<?php p($l->t('Number of guests')); ?>" />
- <input type="text" name="comment" placeholder="<?php p($l->t('Comment')); ?>" />
- </fieldset>
<fieldset>
<input type="submit" value="<?php p($l->t('Save'));?>">
</fieldset>
diff --git a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php
index 576fde2d4af..abeff5473ad 100644
--- a/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php
+++ b/apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php
@@ -381,18 +381,10 @@ EOF;
* @dataProvider attendeeProvider
*/
public function testProcessMoreOptionsResult(bool $isExternalAttendee): void {
- $this->request->expects($this->at(0))
+ $this->request->expects($this->once())
->method('getParam')
->with('partStat')
->willReturn('TENTATIVE');
- $this->request->expects($this->at(1))
- ->method('getParam')
- ->with('guests')
- ->willReturn('7');
- $this->request->expects($this->at(2))
- ->method('getParam')
- ->with('comment')
- ->willReturn('Foo bar Bli blub');
$this->buildQueryExpects('TOKEN123', [
'id' => 0,
@@ -411,14 +403,12 @@ VERSION:2.0
PRODID:-//Nextcloud/Nextcloud CalDAV Server//EN
METHOD:REPLY
BEGIN:VEVENT
-ATTENDEE;PARTSTAT=TENTATIVE;X-RESPONSE-COMMENT=Foo bar Bli blub;X-NUM-GUEST
- S=7:mailto:attendee@foo.bar
+ATTENDEE;PARTSTAT=TENTATIVE:mailto:attendee@foo.bar
ORGANIZER:mailto:organizer@foo.bar
UID:this-is-the-events-uid
SEQUENCE:0
REQUEST-STATUS:2.0;Success
DTSTAMP:19700101T002217Z
-COMMENT:Foo bar Bli blub
END:VEVENT
END:VCALENDAR