2017-06-19 19:57:32 +08:00
|
|
|
import Breakouts from '/imports/api/1.1/breakouts';
|
2016-10-28 01:47:40 +08:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
2017-06-01 01:54:43 +08:00
|
|
|
import mapToAcl from '/imports/startup/mapToAcl';
|
2016-10-28 01:47:40 +08:00
|
|
|
|
2017-06-01 01:54:43 +08:00
|
|
|
function breakouts(credentials) {
|
2016-11-25 03:22:04 +08:00
|
|
|
const {
|
|
|
|
meetingId,
|
|
|
|
requesterUserId,
|
|
|
|
} = credentials;
|
|
|
|
|
|
|
|
return Breakouts.find({
|
2016-11-14 19:57:10 +08:00
|
|
|
$or: [
|
2016-11-25 03:22:04 +08:00
|
|
|
{ breakoutMeetingId: meetingId },
|
|
|
|
{
|
|
|
|
users: {
|
|
|
|
$elemMatch: { userId: requesterUserId },
|
|
|
|
},
|
|
|
|
},
|
2016-11-14 19:57:10 +08:00
|
|
|
],
|
2016-11-25 03:22:04 +08:00
|
|
|
});
|
2017-06-06 03:12:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
function publish(...args) {
|
|
|
|
const boundBreakouts = breakouts.bind(this);
|
|
|
|
return mapToAcl('subscriptions.breakouts', boundBreakouts)(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
Meteor.publish('breakouts', publish);
|