Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(dav): add string comparison for diff
Signed-off-by: Anna Larch <[email protected]>
  • Loading branch information
miaulalala authored and backportbot-nextcloud[bot] committed Apr 12, 2023
commit 29547e15054d63fa75490e01137aba97e0dcfc7e
6 changes: 3 additions & 3 deletions apps/dav/lib/CalDAV/Schedule/IMipService.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private function generateDiffString(VEvent $vevent, VEvent $oldVEvent, string $p
return $default;
}
$newstring = $vevent->$property->getValue();
if(isset($oldVEvent->$property)) {
if(isset($oldVEvent->$property) && $oldVEvent->$property->getValue() !== $newstring ) {
$oldstring = $oldVEvent->$property->getValue();
return sprintf($strikethrough, $oldstring, $newstring);
}
Expand Down Expand Up @@ -128,7 +128,7 @@ public function buildBodyData(VEvent $vEvent, ?VEvent $oldVEvent): array {
$data['meeting_location_html'] = $this->generateDiffString($vEvent, $oldVEvent, 'LOCATION', $data['meeting_location']);

$oldUrl = self::readPropertyWithDefault($oldVEvent, 'URL', $defaultVal);
$data['meeting_url_html'] = !empty($oldUrl) ? sprintf('<a href="%1$s">%1$s</a>', $oldUrl) : $data['meeting_url'];
$data['meeting_url_html'] = !empty($oldUrl) && $oldUrl !== $data['meeting_url'] ? sprintf('<a href="%1$s">%1$s</a>', $oldUrl) : $data['meeting_url'];

$data['meeting_when_html'] =
($oldMeetingWhen !== $data['meeting_when'] && $oldMeetingWhen !== null)
Expand Down Expand Up @@ -472,7 +472,7 @@ public function addAttendees(IEMailTemplate $template, VEvent $vevent) {
*/
public function addBulletList(IEMailTemplate $template, VEvent $vevent, $data) {
$template->addBodyListItem(
$data['meeting_title'], $this->l10n->t('Title:'),
$data['meeting_title_html'] ?? $data['meeting_title'], $this->l10n->t('Title:'),
$this->getAbsoluteImagePath('caldav/title.png'), $data['meeting_title'], '', IMipPlugin::IMIP_INDENT);
if ($data['meeting_when'] !== '') {
$template->addBodyListItem($data['meeting_when_html'] ?? $data['meeting_when'], $this->l10n->t('Time:'),
Expand Down