-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6161 from BobakOftadeh/user-manage-b
User manage button clear status, mute meeting implementation
- Loading branch information
Showing
16 changed files
with
250 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
bigbluebutton-html5/imports/api/voice-users/server/handlers/meetingMuted.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import changeMuteMeeting from '../modifiers/changeMuteMeeting'; | ||
|
||
export default function handleMeetingMuted({ body }, meetingId) { | ||
return changeMuteMeeting(meetingId, body); | ||
} |
4 changes: 4 additions & 0 deletions
4
bigbluebutton-html5/imports/api/voice-users/server/methods.js
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import { Meteor } from 'meteor/meteor'; | ||
import listenOnlyToggle from './methods/listenOnlyToggle'; | ||
import muteToggle from './methods/muteToggle'; | ||
import muteAllToggle from './methods/muteAllToggle'; | ||
import muteAllExceptPresenterToggle from './methods/muteAllExceptPresenterToggle'; | ||
import ejectUserFromVoice from './methods/ejectUserFromVoice'; | ||
|
||
Meteor.methods({ | ||
listenOnlyToggle, | ||
toggleSelfVoice: (credentials) => { muteToggle(credentials, credentials.requesterUserId); }, | ||
toggleVoice: muteToggle, | ||
muteAllUsers: muteAllToggle, | ||
muteAllExceptPresenter: muteAllExceptPresenterToggle, | ||
ejectUserFromVoice, | ||
}); |
24 changes: 24 additions & 0 deletions
24
bigbluebutton-html5/imports/api/voice-users/server/methods/muteAllExceptPresenterToggle.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Meteor } from 'meteor/meteor'; | ||
import { check } from 'meteor/check'; | ||
import RedisPubSub from '/imports/startup/server/redis'; | ||
import Meetings from '/imports/api/meetings'; | ||
|
||
export default function muteAllExceptPresenterToggle(credentials) { | ||
const REDIS_CONFIG = Meteor.settings.private.redis; | ||
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps; | ||
const EVENT_NAME = 'MuteAllExceptPresentersCmdMsg'; | ||
|
||
const { meetingId, requesterUserId } = credentials; | ||
|
||
check(meetingId, String); | ||
check(requesterUserId, String); | ||
const meeting = Meetings.findOne({ meetingId }); | ||
const toggleMeetingMuted = !meeting.voiceProp.muteOnStart; | ||
|
||
const payload = { | ||
mutedBy: requesterUserId, | ||
mute: toggleMeetingMuted, | ||
}; | ||
|
||
RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload); | ||
} |
24 changes: 24 additions & 0 deletions
24
bigbluebutton-html5/imports/api/voice-users/server/methods/muteAllToggle.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Meteor } from 'meteor/meteor'; | ||
import { check } from 'meteor/check'; | ||
import RedisPubSub from '/imports/startup/server/redis'; | ||
import Meetings from '/imports/api/meetings'; | ||
|
||
export default function muteAllToggle(credentials) { | ||
const REDIS_CONFIG = Meteor.settings.private.redis; | ||
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps; | ||
const EVENT_NAME = 'MuteMeetingCmdMsg'; | ||
|
||
const { meetingId, requesterUserId } = credentials; | ||
|
||
check(meetingId, String); | ||
check(requesterUserId, String); | ||
const meeting = Meetings.findOne({ meetingId }); | ||
const toggleMeetingMuted = !meeting.voiceProp.muteOnStart; | ||
|
||
const payload = { | ||
mutedBy: requesterUserId, | ||
mute: toggleMeetingMuted, | ||
}; | ||
|
||
RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload); | ||
} |
35 changes: 35 additions & 0 deletions
35
bigbluebutton-html5/imports/api/voice-users/server/modifiers/changeMuteMeeting.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import Meetings from '/imports/api/meetings'; | ||
import { check } from 'meteor/check'; | ||
import Logger from '/imports/startup/server/logger'; | ||
|
||
export default function changeMuteMeeting(meetingId, payload) { | ||
check(meetingId, String); | ||
check(payload, { | ||
muted: Boolean, | ||
mutedBy: String, | ||
}); | ||
|
||
const selector = { | ||
meetingId, | ||
}; | ||
|
||
const modifier = { | ||
$set: { | ||
'voiceProp.muteOnStart': payload.muted, | ||
}, | ||
}; | ||
|
||
const cb = (err, numChanged) => { | ||
if (err) { | ||
Logger.error(`Changing meeting mute status meeting={${meetingId}} ${err}`); | ||
return; | ||
} | ||
|
||
if (numChanged) { | ||
Logger.info(`Changed meeting mute status meeting=${meetingId}`); | ||
} | ||
}; | ||
|
||
|
||
return Meetings.upsert(selector, modifier, cb); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.