Skip to content

Commit ed1bfe7

Browse files
committed
fix(imip): dont compare events for the reply message
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
1 parent 609c25a commit ed1bfe7

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

apps/dav/lib/CalDAV/Schedule/IMipPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public function schedule(Message $iTipMessage) {
186186
switch (strtolower($iTipMessage->method)) {
187187
case self::METHOD_REPLY:
188188
$method = self::METHOD_REPLY;
189-
$data = $this->imipService->buildBodyData($vEvent, $oldVevent);
189+
$data = $this->imipService->buildReplyBodyData($vEvent);
190190
$replyingAttendee = $this->imipService->getReplyingAttendee($iTipMessage);
191191
break;
192192
case self::METHOD_CANCEL:

apps/dav/lib/CalDAV/Schedule/IMipService.php

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,35 @@ public function buildBodyData(VEvent $vEvent, ?VEvent $oldVEvent): array {
159159
if ($eventReaderCurrent->recurs()) {
160160
$data['meeting_occurring'] = $this->generateOccurringString($eventReaderCurrent);
161161
}
162-
162+
return $data;
163+
}
164+
165+
/**
166+
* @param VEvent $vEvent
167+
* @return array
168+
*/
169+
public function buildReplyBodyData(VEvent $vEvent): array {
170+
// construct event reader
171+
$eventReader = new EventReader($vEvent);
172+
$defaultVal = '';
173+
$data = [];
174+
$data['meeting_when'] = $this->generateWhenString($eventReader);
175+
176+
foreach (self::STRING_DIFF as $key => $property) {
177+
$data[$key] = self::readPropertyWithDefault($vEvent, $property, $defaultVal);
178+
}
179+
180+
if (($locationHtml = $this->linkify($data['meeting_location'])) !== null) {
181+
$data['meeting_location_html'] = $locationHtml;
182+
}
183+
184+
$data['meeting_url_html'] = $data['meeting_url'] ? sprintf('<a href="%1$s">%1$s</a>', $data['meeting_url']) : '';
185+
186+
// generate occurring next string
187+
if ($eventReader->recurs()) {
188+
$data['meeting_occurring'] = $this->generateOccurringString($eventReader);
189+
}
190+
163191
return $data;
164192
}
165193

0 commit comments

Comments
 (0)