The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/api/server/v1/video-conference.js

29 lines
767 B

import { Meteor } from 'meteor/meteor';
import { Rooms } from '../../../models/server';
import { API } from '../api';
API.v1.addRoute(
'video-conference/jitsi.update-timeout',
{ authRequired: true },
{
post() {
const { roomId, joiningNow = true } = this.bodyParams;
if (!roomId) {
return API.v1.failure('The "roomId" parameter is required!');
}
const room = Rooms.findOneById(roomId, { fields: { _id: 1 } });
if (!room) {
return API.v1.failure('Room does not exist!');
}
try {
const jitsiTimeout = Meteor.runAsUser(this.userId, () => Meteor.call('jitsi:updateTimeout', roomId, Boolean(joiningNow)));
return API.v1.success({ jitsiTimeout });
} catch (error) {
return API.v1.failure(error.message);
}
},
},
);