bigbluebutton-Github/bigbluebutton-html5/imports/api/annotations/server/methods/undoAnnotation.js

28 lines
910 B
JavaScript
Raw Normal View History

import RedisPubSub from '/imports/startup/server/redis';
2017-04-20 02:27:00 +08:00
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import { extractCredentials } from '/imports/api/common/server/helpers';
2021-05-04 22:38:56 +08:00
import Logger from '/imports/startup/server/logger';
2017-04-20 02:27:00 +08:00
export default function undoAnnotation(whiteboardId) {
const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
const EVENT_NAME = 'UndoWhiteboardPubMsg';
2017-04-20 02:27:00 +08:00
2021-05-04 22:38:56 +08:00
try {
const { meetingId, requesterUserId } = extractCredentials(this.userId);
2017-04-20 02:27:00 +08:00
2021-05-04 22:38:56 +08:00
check(meetingId, String);
check(requesterUserId, String);
check(whiteboardId, String);
2017-04-20 02:27:00 +08:00
2021-05-04 22:38:56 +08:00
const payload = {
whiteboardId,
};
2017-04-20 02:27:00 +08:00
2021-05-04 22:38:56 +08:00
return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);
} catch (err) {
Logger.error(`Exception while invoking method undoAnnotation ${err.stack}`);
}
2017-04-20 02:27:00 +08:00
}