From 6503e735f494bf72aa3733d879c51e76aef03e7b Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Tue, 24 Jun 2025 18:31:09 +0500 Subject: [PATCH] Fix office empty meeting (#9353) Signed-off-by: Denis Bykhov --- server-plugins/love-resources/src/index.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/server-plugins/love-resources/src/index.ts b/server-plugins/love-resources/src/index.ts index ebb4832d9e..86d0477435 100644 --- a/server-plugins/love-resources/src/index.ts +++ b/server-plugins/love-resources/src/index.ts @@ -224,6 +224,9 @@ async function roomJoinHandler (info: ParticipantInfo, control: TriggerControl): ) } } else { + const room = (await control.findAll(control.ctx, love.class.Room, { _id: info.room }))[0] + if (room === undefined) return res + if (isOffice(room) && room.person === info.person) return res const _id = generateId() const date = new Date() .toLocaleDateString('en-GB', { @@ -255,6 +258,21 @@ async function roomJoinHandler (info: ParticipantInfo, control: TriggerControl): collaborator: info.account }) ) + if (isOffice(room) && room.person !== info.person && room.person !== null) { + const person = ( + await control.findAll(control.ctx, contact.mixin.Employee, { _id: room.person as Ref }) + )[0] + if (person?.personUuid !== undefined) { + res.push( + control.txFactory.createTxCreateDoc(core.class.Collaborator, core.space.Workspace, { + attachedTo: _id, + attachedToClass: love.class.MeetingMinutes, + collection: 'collaborators', + collaborator: person.personUuid + }) + ) + } + } } } return res