Skip to content

Commit

Permalink
fixup! feat(caldav): linkify location in scheduling mails
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst committed Aug 9, 2023
1 parent d4ccf41 commit ed64f30
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions apps/dav/lib/CalDAV/Schedule/IMipService.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,20 @@ private function generateDiffString(VEvent $vevent, VEvent $oldVEvent, string $p
* Like generateDiffString() but linkifies the property values if they are urls.
*/
private function generateLinkifiedDiffString(VEvent $vevent, VEvent $oldVEvent, string $property, string $default): ?string {
$strikethrough = "<span style='text-decoration: line-through'>%s</span><br />%s";
if (!isset($vevent->$property)) {
return $default;
}
/** @var string|null $newstring */
$newstring = $vevent->$property->getValue();
if (isset($oldVEvent->$property) && $oldVEvent->$property->getValue() !== $newstring) {
$oldstring = $oldVEvent->$property->getValue();
return sprintf($strikethrough, $this->linkify($oldstring) ?? $oldstring, $this->linkify($newstring) ?? $newstring);
}
return $this->linkify($newstring) ?? $newstring;
/** @var string|null $newString */
$newString = $vevent->$property->getValue();
$oldString = isset($oldVEvent->$property) ? $oldVEvent->$property->getValue() : null;
if ($oldString !== $newString) {
return sprintf(
"<span style='text-decoration: line-through'>%s</span><br />%s",
$this->linkify($oldString) ?? $oldString ?? '',
$this->linkify($newString) ?? $newString ?? ''
);
}
return $this->linkify($newString) ?? $newString;
}

/**
Expand Down

0 comments on commit ed64f30

Please sign in to comment.