Skip to content

Commit

Permalink
Allow more foreign events (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
lyind committed Mar 13, 2024
1 parent a1997f6 commit 52f070c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sync-timeoffs/SyncTimeOffs.js
Expand Up @@ -907,7 +907,10 @@ async function queryPersonioTimeOffs_(personio, timeMin, timeMax, employeeId) {
function convertOutOfOfficeToTimeOff_(timeOffTypeConfig, employee, event, existingTimeOff) {

// skip events created by other users
if (event?.creator?.email && event?.creator?.email !== employee.attributes.email.value) {
const email = employee.attributes.email.value;
if (event.creator?.email !== email
&& event.organizer?.email !== email
&& (!event.attendees || !event.attendees.some(attendee => attendee.email === email && attendee.responseStatus && attendee.responseStatus !== "declined"))) {
return undefined;
}

Expand Down

0 comments on commit 52f070c

Please sign in to comment.