@@ -53,10 +53,10 @@ interpretMeetingsSubsystem = interpret $ \case
5353 updateMeetingImpl zUser meetingId update
5454 DeleteMeeting zUser meetingId ->
5555 deleteMeetingImpl zUser meetingId
56- AddInvitedEmail zUser meetingId email ->
57- addInvitedEmailImpl zUser meetingId email
58- RemoveInvitedEmail zUser meetingId email ->
59- removeInvitedEmailImpl zUser meetingId email
56+ AddInvitedEmails zUser meetingId emails ->
57+ addInvitedEmailsImpl zUser meetingId emails
58+ RemoveInvitedEmails zUser meetingId emails ->
59+ removeInvitedEmailsImpl zUser meetingId emails
6060 CleanupOldMeetings cutoffTime batchSize ->
6161 cleanupOldMeetingsImpl cutoffTime batchSize
6262
@@ -73,43 +73,39 @@ createMeetingImpl zUser newMeeting = do
7373 meetingId <- liftIO $ MeetingId <$> UUIDV4. nextRandom
7474 let qMeetingId = tUntagged (qualifyAs zUser meetingId)
7575
76- -- Use provided conversation or create a new one with MeetingConversation type
77- qConvId <- case newMeeting. conversationId of
78- Just cid -> pure cid
79- Nothing -> do
80- -- Generate new conversation ID
81- convId <- liftIO $ randomId
82- let lConvId = qualifyAs zUser convId
76+ -- Generate new conversation ID
77+ convId <- liftIO $ randomId
78+ let lConvId = qualifyAs zUser convId
8379
84- -- Create conversation metadata for a meeting
85- let metadata =
86- ConversationMetadata
87- { cnvmType = RegularConv ,
88- cnvmCreator = Just (tUnqualified zUser),
89- cnvmAccess = [] ,
90- cnvmAccessRoles = Set. empty,
91- cnvmName = Just newMeeting. title,
92- cnvmTeam = Nothing ,
93- cnvmMessageTimer = Nothing ,
94- cnvmReceiptMode = Nothing ,
95- cnvmGroupConvType = Just MeetingConversation ,
96- cnvmChannelAddPermission = Nothing ,
97- cnvmCellsState = CellsDisabled ,
98- cnvmParent = Nothing
99- }
80+ -- Create conversation metadata for a meeting
81+ let metadata =
82+ ConversationMetadata
83+ { cnvmType = RegularConv ,
84+ cnvmCreator = Just (tUnqualified zUser),
85+ cnvmAccess = [] ,
86+ cnvmAccessRoles = Set. empty,
87+ cnvmName = Just newMeeting. title,
88+ cnvmTeam = Nothing ,
89+ cnvmMessageTimer = Nothing ,
90+ cnvmReceiptMode = Nothing ,
91+ cnvmGroupConvType = Just MeetingConversation ,
92+ cnvmChannelAddPermission = Nothing ,
93+ cnvmCellsState = CellsDisabled ,
94+ cnvmParent = Nothing
95+ }
10096
101- -- Create conversation with the meeting creator as the only member (admin role)
102- let newConv =
103- NewConversation
104- { metadata = metadata,
105- users = UserList [(tUnqualified zUser, roleNameWireAdmin)] [] ,
106- protocol = BaseProtocolProteusTag ,
107- groupId = Nothing
108- }
97+ -- Create conversation with the meeting creator as the only member (admin role)
98+ let newConv =
99+ NewConversation
100+ { metadata = metadata,
101+ users = UserList [(tUnqualified zUser, roleNameWireAdmin)] [] ,
102+ protocol = BaseProtocolProteusTag ,
103+ groupId = Nothing
104+ }
109105
110- -- Store the conversation
111- storedConv <- ConvStore. upsertConversation lConvId newConv
112- pure $ tUntagged (qualifyAs zUser storedConv. id_)
106+ -- Store the conversation
107+ storedConv <- ConvStore. upsertConversation lConvId newConv
108+ let qConvId = tUntagged (qualifyAs zUser storedConv. id_)
113109
114110 -- Determine trial status
115111 -- TODO: Check if user is a paying customer via Feature
@@ -248,13 +244,13 @@ deleteMeetingImpl zUser meetingId = do
248244
249245 pure True
250246
251- addInvitedEmailImpl ::
247+ addInvitedEmailsImpl ::
252248 (Member Store. MeetingsStore r ) =>
253249 Local UserId ->
254250 Qualified MeetingId ->
255- EmailAddress ->
251+ [ EmailAddress ] ->
256252 Sem r Bool
257- addInvitedEmailImpl zUser meetingId email = do
253+ addInvitedEmailsImpl zUser meetingId emails = do
258254 -- Get existing meeting
259255 maybeMeeting <- Store. getMeeting meetingId
260256 case maybeMeeting of
@@ -265,16 +261,16 @@ addInvitedEmailImpl zUser meetingId email = do
265261 then pure False
266262 else do
267263 -- Add invited email
268- Store. addInvitedEmail meetingId email
264+ Store. addInvitedEmails meetingId emails
269265 pure True
270266
271- removeInvitedEmailImpl ::
267+ removeInvitedEmailsImpl ::
272268 (Member Store. MeetingsStore r ) =>
273269 Local UserId ->
274270 Qualified MeetingId ->
275- EmailAddress ->
271+ [ EmailAddress ] ->
276272 Sem r Bool
277- removeInvitedEmailImpl zUser meetingId email = do
273+ removeInvitedEmailsImpl zUser meetingId emails = do
278274 -- Get existing meeting
279275 maybeMeeting <- Store. getMeeting meetingId
280276 case maybeMeeting of
@@ -285,7 +281,7 @@ removeInvitedEmailImpl zUser meetingId email = do
285281 then pure False
286282 else do
287283 -- Remove invited email
288- Store. removeInvitedEmail meetingId email
284+ Store. removeInvitedEmails meetingId emails
289285 pure True
290286
291287cleanupOldMeetingsImpl ::
0 commit comments