Merge pull request #12256 from Tainan404/filter-bymeetingId

Add filter by meetingId in server queries
This commit is contained in:
Anton Georgiev 2021-05-07 10:36:20 -04:00 committed by GitHub
commit 5e11fb314b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 7 deletions

View File

@ -1,6 +1,7 @@
import RedisPubSub from '/imports/startup/server/redis';
import Captions from '/imports/api/captions';
import Logger from '/imports/startup/server/logger';
import { extractCredentials } from '/imports/api/common/server/helpers';
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
@ -14,7 +15,8 @@ export default function editCaptions(padId, data) {
check(padId, String);
check(data, String);
const pad = Captions.findOne({ padId });
const { meetingId: creadentialMeetingId } = extractCredentials(this.userId);
const pad = Captions.findOne({ padId, meetingId: creadentialMeetingId });
if (!pad) {
Logger.error(`Editing captions history: ${padId}`);

View File

@ -20,7 +20,7 @@ function groupChatMsg(chatsIds) {
Logger.debug('Publishing group-chat-msg', { meetingId, userId });
const User = Users.findOne({ userId });
const User = Users.findOne({ userId, meetingId });
const selector = {
timestamp: { $gte: User.authTokenValidatedTime },
$or: [

View File

@ -15,7 +15,11 @@ export default function publishVote(pollId, pollAnswerId) {
check(pollAnswerId, Number);
check(pollId, String);
const allowedToVote = Polls.findOne({ id: pollId, users: { $in: [requesterUserId] } }, {
const allowedToVote = Polls.findOne({
id: pollId,
users: { $in: [requesterUserId] },
meetingId,
}, {
fields: {
users: 1,
},

View File

@ -14,7 +14,7 @@ function userSettings() {
const { meetingId, userId } = tokenValidation;
const currentUser = User.findOne({ userId });
const currentUser = User.findOne({ userId, meetingId });
if (currentUser && currentUser.breakoutProps.isBreakoutUser) {
const { parentId } = currentUser.breakoutProps;

View File

@ -12,9 +12,9 @@ const getDeviceId = (stream) => {
return stream;
};
const getUserName = (userId) => {
const getUserName = (userId, meetingId) => {
const user = Users.findOne(
{ userId },
{ userId, meetingId },
{ fields: { name: 1 } },
);
if (user) return user.name;

View File

@ -15,7 +15,7 @@ export default function sharedWebcam(meetingId, userId, stream) {
check(stream, String);
const deviceId = getDeviceId(stream);
const name = getUserName(userId);
const name = getUserName(userId, meetingId);
const vu = VoiceUsers.findOne(
{ meetingId, intId: userId },
{ fields: { floor: 1, lastFloorTime: 1 }}