1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 02:32:42 +01:00

Don't notify without notifiable attendees

Summary: Events with no attendees (e.g. fresh instances of recurring events) would trigger an exception when sending notifications, because `$attendee_map` would still get populated.

Test Plan: Declined event, restarted daemons. Did not see exception. Accepted event, restarted daemons. Saw "[Calendar] [Reminder]" email.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D18835
This commit is contained in:
Dmitri Iouchtchenko 2017-12-21 12:46:45 -08:00 committed by epriestley
parent e411d75964
commit 393824656f

View file

@ -100,10 +100,11 @@ final class PhabricatorCalendarNotificationEngine
} }
$notifiable_phids[] = $invitee->getInviteePHID(); $notifiable_phids[] = $invitee->getInviteePHID();
} }
if (!$notifiable_phids) { if ($notifiable_phids) {
$attendee_map[$key] = array_fuse($notifiable_phids);
} else {
unset($events[$key]); unset($events[$key]);
} }
$attendee_map[$key] = array_fuse($notifiable_phids);
} }
if (!$attendee_map) { if (!$attendee_map) {
// None of the events have any notifiable attendees, so there is no // None of the events have any notifiable attendees, so there is no