diff --git a/bigbluebutton-html5/imports/api/breakouts/server/methods.js b/bigbluebutton-html5/imports/api/breakouts/server/methods.js index 0d8c52be41..9958a42d5e 100755 --- a/bigbluebutton-html5/imports/api/breakouts/server/methods.js +++ b/bigbluebutton-html5/imports/api/breakouts/server/methods.js @@ -1,8 +1,6 @@ import { Meteor } from 'meteor/meteor'; import requestJoinURL from './methods/requestJoinURL'; -import setBreakoutsTime from '/imports/api/breakouts/server/methods/setBreakoutsTime'; Meteor.methods({ requestJoinURL, - setBreakoutsTime, }); diff --git a/bigbluebutton-html5/imports/api/breakouts/server/methods/setBreakoutsTime.js b/bigbluebutton-html5/imports/api/breakouts/server/methods/setBreakoutsTime.js deleted file mode 100644 index 0001692862..0000000000 --- a/bigbluebutton-html5/imports/api/breakouts/server/methods/setBreakoutsTime.js +++ /dev/null @@ -1,28 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import RedisPubSub from '/imports/startup/server/redis'; -import { extractCredentials } from '/imports/api/common/server/helpers'; -import { check } from 'meteor/check'; -import Logger from '/imports/startup/server/logger'; - -export default function setBreakoutsTime({ timeInMinutes }) { - const REDIS_CONFIG = Meteor.settings.private.redis; - const CHANNEL = REDIS_CONFIG.channels.toAkkaApps; - const EVENT_NAME = 'UpdateBreakoutRoomsTimeReqMsg'; - - try { - const { meetingId, requesterUserId } = extractCredentials(this.userId); - - check(meetingId, String); - check(requesterUserId, String); - - RedisPubSub.publishUserMessage( - CHANNEL, EVENT_NAME, meetingId, requesterUserId, - { - meetingId, - timeInMinutes, - }, - ); - } catch (err) { - Logger.error(`Exception while invoking method setBreakoutsTime ${err.stack}`); - } -} diff --git a/bigbluebutton-html5/imports/ui/components/breakout-room/container.jsx b/bigbluebutton-html5/imports/ui/components/breakout-room/container.jsx index 039bd6efa9..d795100757 100644 --- a/bigbluebutton-html5/imports/ui/components/breakout-room/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/breakout-room/container.jsx @@ -12,7 +12,7 @@ import { } from '/imports/ui/components/audio/audio-modal/service'; import { makeCall } from '/imports/ui/services/api'; import useCurrentUser from '/imports/ui/core/hooks/useCurrentUser'; -import { BREAKOUT_ROOM_END_ALL } from './mutations'; +import { BREAKOUT_ROOM_END_ALL, BREAKOUT_ROOM_SET_TIME } from './mutations'; import logger from '/imports/startup/client/logger'; const BreakoutContainer = (props) => { @@ -26,15 +26,23 @@ const BreakoutContainer = (props) => { const isRTL = layoutSelect((i) => i.isRTL); const [breakoutRoomEndAll] = useMutation(BREAKOUT_ROOM_END_ALL); + const [breakoutRoomSetTime] = useMutation(BREAKOUT_ROOM_SET_TIME); const endAllBreakouts = () => { Service.setCapturedContentUploading(); breakoutRoomEndAll(); }; + const setBreakoutsTime = (timeInMinutes) => { + if (timeInMinutes <= 0) return false; + + return breakoutRoomSetTime({ variables: { timeInMinutes } }); + }; + return ; }; @@ -42,7 +50,6 @@ const BreakoutContainer = (props) => { export default withTracker((props) => { const { requestJoinURL, - setBreakoutsTime, isNewTimeHigherThanMeetingRemaining, findBreakouts, getBreakoutRoomUrl, @@ -90,7 +97,6 @@ export default withTracker((props) => { ...props, breakoutRooms, requestJoinURL, - setBreakoutsTime, isNewTimeHigherThanMeetingRemaining, getBreakoutRoomUrl, transferUserToMeeting, diff --git a/bigbluebutton-html5/imports/ui/components/breakout-room/mutations.tsx b/bigbluebutton-html5/imports/ui/components/breakout-room/mutations.tsx index b4f69c9a3f..2c5ee4a97b 100644 --- a/bigbluebutton-html5/imports/ui/components/breakout-room/mutations.tsx +++ b/bigbluebutton-html5/imports/ui/components/breakout-room/mutations.tsx @@ -48,6 +48,14 @@ export const BREAKOUT_ROOM_SEND_MESSAGE_TO_ALL = gql` } `; +export const BREAKOUT_ROOM_SET_TIME = gql` + mutation BreakoutRoomSetTime($timeInMinutes: Int!) { + breakoutRoomSetTime( + timeInMinutes: $timeInMinutes, + ) + } +`; + export default { BREAKOUT_ROOM_CREATE, BREAKOUT_ROOM_END_ALL, diff --git a/bigbluebutton-html5/imports/ui/components/breakout-room/service.js b/bigbluebutton-html5/imports/ui/components/breakout-room/service.js index 123120ac62..e50d480102 100644 --- a/bigbluebutton-html5/imports/ui/components/breakout-room/service.js +++ b/bigbluebutton-html5/imports/ui/components/breakout-room/service.js @@ -96,16 +96,6 @@ const isNewTimeHigherThanMeetingRemaining = (newTimeInMinutes) => { return false; }; -const setBreakoutsTime = (timeInMinutes) => { - if (timeInMinutes <= 0) return false; - - makeCall('setBreakoutsTime', { - timeInMinutes, - }); - - return true; -}; - const transferUserToMeeting = (fromMeetingId, toMeetingId) => makeCall('transferUser', fromMeetingId, toMeetingId); @@ -204,7 +194,6 @@ const isUserInBreakoutRoom = (joinedUsers) => { export default { findBreakouts, - setBreakoutsTime, isNewTimeHigherThanMeetingRemaining, requestJoinURL, getBreakoutRoomUrl,