Merge pull request #8700 from capilkey/external-video-extractcredentials

Fix external video extractCredentials usage
This commit is contained in:
Anton Georgiev 2020-03-03 17:28:39 -05:00 committed by GitHub
commit 226c3b12e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,19 +3,18 @@ import Logger from '/imports/startup/server/logger';
import { extractCredentials } from '/imports/api/common/server/helpers';
export default function emitExternalVideoEvent(messageName, ...rest) {
const { meetingId, userId } = extractCredentials(this.userId);
const { meetingId, requesterUserId: userId } = extractCredentials(this.userId);
const user = Users.findOne({ userId });
const user = Users.findOne({ userId, meetingId });
if (user && user.presenter) {
const streamerName = `external-videos-${meetingId}`;
const streamer = Meteor.StreamerCentral.instances[streamerName];
if (streamer) {
streamer.emit(messageName, ...rest)
streamer.emit(messageName, ...rest);
} else {
Logger.error(`External Video Streamer not found for meetingId: ${meetingId} userId: ${userId}`);
}
}
}