Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not supported calendar message.ics #1305

Open
warfriet opened this issue Nov 16, 2024 · 0 comments
Open

not supported calendar message.ics #1305

warfriet opened this issue Nov 16, 2024 · 0 comments

Comments

@warfriet
Copy link

Baikal version: 0.10.1

Expected behaviour:
When I invite a person via email the ics file is not supported with MS Outlook.

I have changed the CalendarObject.php at the put():
public function put($calendarData)
{
if (is_resource($calendarData)) {
$calendarData = stream_get_contents($calendarData);
}

// Ensure event data begins with BEGIN:VEVENT
if (strpos($calendarData, "BEGIN:VEVENT") !== false) {
    $eventStartPos = strpos($calendarData, "BEGIN:VEVENT") + strlen("BEGIN:VEVENT\n");

    // Insert UID if missing
    if (strpos($calendarData, 'UID:') === false) {
        $uid = "UID:" . uniqid() . "@example.com\n";
        $calendarData = substr_replace($calendarData, $uid, $eventStartPos, 0);
    }

    // Insert SUMMARY if missing
    if (strpos($calendarData, 'SUMMARY:') === false) {
        $summary = "SUMMARY:Untitled Event\n";
        $calendarData = substr_replace($calendarData, $summary, $eventStartPos, 0);
    }
}

// Fold long lines
$lines = explode("\n", $calendarData);
foreach ($lines as &$line) {
    if (strlen($line) > 75) {
        $line = foldLine($line);
    }
}
$calendarData = implode("\n", $lines);

// Update the calendar object in the backend
$etag = $this->caldavBackend->updateCalendarObject(
    $this->calendarInfo['id'],
    $this->objectData['uri'],
    $calendarData
);

$this->objectData['calendardata'] = $calendarData;
$this->objectData['etag'] = $etag;

return $etag;

}

Current behaviour:
When received in MS Outlook the file is marked as not supported calendar message.ics
Looks if Baikal does not make an correct ics file.
This is in the ics file:
ATTENDEE;CN=Person Company;PARTSTAT=NEEDS-ACTION;CUTYPE=INDIVIDUAL;
ROLE=REQ-PARTICIPANT:mailto:[email protected]
ATTENDEE;PARTSTAT=ACCEPTED;CUTYPE=INDIVIDUAL;
ROLE=REQ-PARTICIPANT:mailto:[email protected]
DTSTART;TZID=Europe/Berlin:20241116T113000
DTEND;TZID=Europe/Berlin:20241116T133000
TRANSP:OPAQUE
LOCATION:https://myn.nl/trainingen/myn-academy-get-the-cake
X-MOZ-GENERATION:3
SEQUENCE:2
DTSTAMP:20241114T161806Z
BEGIN:VALARM
ACTION:DISPLAY
TRIGGER:PT0S
DESCRIPTION:Default Mozilla Description
END:VALARM
END:VEVENT
END:VCALENDAR

Is this a common bug?
Can it be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant