Skip to content

Commit 866b6cc

Browse files
authored
fix: attendess are not showing (calcom#23255)
1 parent cafecad commit 866b6cc

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

packages/app-store/googlecalendar/lib/CalendarService.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type { FreeBusyArgs } from "@calcom/features/calendar-cache/calendar-cach
1010
import { getTimeMax, getTimeMin } from "@calcom/features/calendar-cache/lib/datesForCache";
1111
import { getLocation, getRichDescription } from "@calcom/lib/CalEventParser";
1212
import { uniqueBy } from "@calcom/lib/array";
13+
import { ORGANIZER_EMAIL_EXEMPT_DOMAINS } from "@calcom/lib/constants";
1314
import logger from "@calcom/lib/logger";
1415
import { safeStringify } from "@calcom/lib/safeStringify";
1516
import { SelectedCalendarRepository } from "@calcom/lib/server/repository/selectedCalendar";
@@ -85,10 +86,16 @@ export default class GoogleCalendarService implements Calendar {
8586
const selectedHostDestinationCalendar = event.destinationCalendar?.find(
8687
(cal) => cal.credentialId === this.credential.id
8788
);
89+
90+
const isOrganizerExempt = ORGANIZER_EMAIL_EXEMPT_DOMAINS?.split(",")
91+
.filter((domain) => domain.trim() !== "")
92+
.some((domain) => event.organizer.email.toLowerCase().endsWith(domain.toLowerCase()));
93+
8894
const eventAttendees = event.attendees.map(({ id: _id, ...rest }) => ({
8995
...rest,
9096
responseStatus: "accepted",
9197
}));
98+
9299
const attendees: calendar_v3.Schema$EventAttendee[] = [
93100
{
94101
...event.organizer,
@@ -100,7 +107,7 @@ export default class GoogleCalendarService implements Calendar {
100107
// We use || instead of ?? here to handle empty strings
101108
email: hostExternalCalendarId || selectedHostDestinationCalendar?.externalId || event.organizer.email,
102109
},
103-
...eventAttendees,
110+
...(event.hideOrganizerEmail && !isOrganizerExempt ? [] : eventAttendees),
104111
];
105112

106113
if (event.team?.members) {

packages/lib/CalendarManager.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { sortBy } from "lodash";
33

44
import { getCalendar } from "@calcom/app-store/_utils/getCalendar";
5+
import { MeetLocationType } from "@calcom/app-store/locations";
56
import getApps from "@calcom/app-store/utils";
67
import dayjs from "@calcom/dayjs";
78
import { getUid } from "@calcom/lib/CalEventParser";
@@ -494,12 +495,14 @@ const processEvent = (calEvent: CalendarEvent): CalendarServiceEvent => {
494495
calendarDescription: getRichDescription(calEvent),
495496
};
496497

498+
const isMeetLocationType = calEvent.location === MeetLocationType;
499+
497500
// Determine if the calendar event should include attendees
498501
const isOrganizerExempt = ORGANIZER_EMAIL_EXEMPT_DOMAINS?.split(",")
499502
.filter((domain) => domain.trim() !== "")
500503
.some((domain) => calEvent.organizer.email.toLowerCase().endsWith(domain.toLowerCase()));
501504

502-
if (calEvent.hideOrganizerEmail && !isOrganizerExempt) {
505+
if (calEvent.hideOrganizerEmail && !isOrganizerExempt && !isMeetLocationType) {
503506
calendarEvent.attendees = [];
504507
}
505508

0 commit comments

Comments
 (0)