Skip to content

Commit e6f23f5

Browse files
miaulalalaPVince81
authored andcommitted
Remove comment and guests option from Invitations UI
Signed-off-by: Anna Larch <anna@nextcloud.com>
1 parent 761221b commit e6f23f5

File tree

3 files changed

+4
-33
lines changed

3 files changed

+4
-33
lines changed

apps/dav/lib/Controller/InvitationResponseController.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,13 @@ public function options(string $token):TemplateResponse {
140140
*/
141141
public function processMoreOptionsResult(string $token):TemplateResponse {
142142
$partstat = $this->request->getParam('partStat');
143-
$guests = (int) $this->request->getParam('guests');
144-
$comment = $this->request->getParam('comment');
145143

146144
$row = $this->getTokenInformation($token);
147145
if (!$row || !\in_array($partstat, ['ACCEPTED', 'DECLINED', 'TENTATIVE'])) {
148146
return new TemplateResponse($this->appName, 'schedule-response-error', [], 'guest');
149147
}
150148

151-
$iTipMessage = $this->buildITipResponse($row, $partstat, $guests, $comment);
149+
$iTipMessage = $this->buildITipResponse($row, $partstat);
152150
$this->responseServer->handleITipMessage($iTipMessage);
153151
if ($iTipMessage->getScheduleStatus() === '1.2') {
154152
return new TemplateResponse($this->appName, 'schedule-response-success', [], 'guest');
@@ -190,8 +188,7 @@ private function getTokenInformation(string $token) {
190188
* @param string|null $comment
191189
* @return Message
192190
*/
193-
private function buildITipResponse(array $row, string $partStat, int $guests = null,
194-
string $comment = null):Message {
191+
private function buildITipResponse(array $row, string $partStat):Message {
195192
$iTipMessage = new Message();
196193
$iTipMessage->uid = $row['uid'];
197194
$iTipMessage->component = 'VEVENT';
@@ -225,19 +222,7 @@ private function buildITipResponse(array $row, string $partStat, int $guests = n
225222
$row['uid'], $row['sequence'] ?? 0, $row['recurrenceid'] ?? ''
226223
]));
227224
$vEvent = $vObject->{'VEVENT'};
228-
/** @var \Sabre\VObject\Property\ICalendar\CalAddress $attendee */
229-
$attendee = $vEvent->{'ATTENDEE'};
230-
231225
$vEvent->DTSTAMP = date('Ymd\\THis\\Z', $this->timeFactory->getTime());
232-
233-
if ($comment) {
234-
$attendee->add('X-RESPONSE-COMMENT', $comment);
235-
$vEvent->add('COMMENT', $comment);
236-
}
237-
if ($guests) {
238-
$attendee->add('X-NUM-GUESTS', $guests);
239-
}
240-
241226
$iTipMessage->message = $vObject;
242227

243228
return $iTipMessage;

apps/dav/templates/schedule-response-options.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
</label>
2626
</div>
2727
</fieldset>
28-
<fieldset id="more_options">
29-
<input type="number" min="0" name="guests" placeholder="<?php p($l->t('Number of guests')); ?>" />
30-
<input type="text" name="comment" placeholder="<?php p($l->t('Comment')); ?>" />
31-
</fieldset>
3228
<fieldset>
3329
<input type="submit" value="<?php p($l->t('Save'));?>">
3430
</fieldset>

apps/dav/tests/unit/Controller/InvitationResponseControllerTest.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -379,18 +379,10 @@ public function testOptions() {
379379
* @dataProvider attendeeProvider
380380
*/
381381
public function testProcessMoreOptionsResult(bool $isExternalAttendee): void {
382-
$this->request->expects($this->at(0))
382+
$this->request->expects($this->once())
383383
->method('getParam')
384384
->with('partStat')
385385
->willReturn('TENTATIVE');
386-
$this->request->expects($this->at(1))
387-
->method('getParam')
388-
->with('guests')
389-
->willReturn('7');
390-
$this->request->expects($this->at(2))
391-
->method('getParam')
392-
->with('comment')
393-
->willReturn('Foo bar Bli blub');
394386

395387
$this->buildQueryExpects('TOKEN123', [
396388
'id' => 0,
@@ -409,14 +401,12 @@ public function testProcessMoreOptionsResult(bool $isExternalAttendee): void {
409401
PRODID:-//Nextcloud/Nextcloud CalDAV Server//EN
410402
METHOD:REPLY
411403
BEGIN:VEVENT
412-
ATTENDEE;PARTSTAT=TENTATIVE;X-RESPONSE-COMMENT=Foo bar Bli blub;X-NUM-GUEST
413-
S=7:mailto:attendee@foo.bar
404+
ATTENDEE;PARTSTAT=TENTATIVE:mailto:attendee@foo.bar
414405
ORGANIZER:mailto:organizer@foo.bar
415406
UID:this-is-the-events-uid
416407
SEQUENCE:0
417408
REQUEST-STATUS:2.0;Success
418409
DTSTAMP:19700101T002217Z
419-
COMMENT:Foo bar Bli blub
420410
END:VEVENT
421411
END:VCALENDAR
422412

0 commit comments

Comments
 (0)