Skip to content

Commit db8e571

Browse files
author
tchapi
committed
Fallback to the sender name
1 parent a0f2b15 commit db8e571

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/Plugins/DavisIMipPlugin.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,19 @@ public function schedule(ITip\Message $itip)
7676
$senderName = $itip->senderName ?? $senderEmail;
7777
$recipientName = $itip->recipientName;
7878

79+
// For a REPLY, the attendee is the sender. If the stored event had no CN for
80+
// them, the Broker leaves it out of the iTIP payload and some mail clients
81+
// (Apple Mail for instance) render the attendee name as "(null)".
82+
// We put the fallback name in the payload too. A REPLY can carry one VEVENT
83+
// per recurrence instance, so we go through all of them.
84+
if ('REPLY' === strtoupper($itip->method)) {
85+
foreach ($itip->message->VEVENT as $vevent) {
86+
if (isset($vevent->ATTENDEE) && !isset($vevent->ATTENDEE['CN'])) {
87+
$vevent->ATTENDEE['CN'] = $senderName;
88+
}
89+
}
90+
}
91+
7992
$subject = 'CalDAV message';
8093
switch (strtoupper($itip->method)) {
8194
case 'REPLY':

0 commit comments

Comments
 (0)