2021-10-20 04:35:39 +08:00
|
|
|
import Meetings from '/imports/api/meetings';
|
2020-10-03 01:29:27 +08:00
|
|
|
import Auth from '/imports/ui/services/auth';
|
2019-02-27 01:08:15 +08:00
|
|
|
|
2020-02-04 04:41:12 +08:00
|
|
|
const getGuestPolicy = () => {
|
|
|
|
const meeting = Meetings.findOne(
|
|
|
|
{ meetingId: Auth.meetingID },
|
2024-03-26 19:57:28 +08:00
|
|
|
{ fields: { 'usersPolicies.guestPolicy': 1 } },
|
2020-02-04 04:41:12 +08:00
|
|
|
);
|
|
|
|
|
2024-03-26 19:57:28 +08:00
|
|
|
return meeting.usersPolicies.guestPolicy;
|
2020-02-04 04:41:12 +08:00
|
|
|
};
|
|
|
|
|
2021-09-04 19:45:52 +08:00
|
|
|
const isWaitingRoomEnabled = () => getGuestPolicy() === 'ASK_MODERATOR';
|
|
|
|
|
2020-10-03 01:29:27 +08:00
|
|
|
const getGuestLobbyMessage = () => {
|
|
|
|
const meeting = Meetings.findOne(
|
|
|
|
{ meetingId: Auth.meetingID },
|
|
|
|
{ fields: { guestLobbyMessage: 1 } },
|
|
|
|
);
|
|
|
|
|
|
|
|
if (meeting) return meeting.guestLobbyMessage;
|
|
|
|
|
|
|
|
return '';
|
|
|
|
};
|
|
|
|
|
2022-01-12 22:10:30 +08:00
|
|
|
const privateMessageVisible = (id) => {
|
|
|
|
const privateInputSpace = document.getElementById(id);
|
2024-01-10 20:07:38 +08:00
|
|
|
if (privateInputSpace.style.display === 'block') {
|
|
|
|
privateInputSpace.style.display = 'none';
|
2022-01-12 22:10:30 +08:00
|
|
|
} else {
|
2024-01-10 20:07:38 +08:00
|
|
|
privateInputSpace.style.display = 'block';
|
2022-01-12 22:10:30 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-02-27 01:08:15 +08:00
|
|
|
export default {
|
2022-01-12 22:10:30 +08:00
|
|
|
privateMessageVisible,
|
2020-02-04 04:41:12 +08:00
|
|
|
getGuestPolicy,
|
2021-09-04 19:45:52 +08:00
|
|
|
isWaitingRoomEnabled,
|
2020-10-03 01:29:27 +08:00
|
|
|
getGuestLobbyMessage,
|
2019-02-27 01:08:15 +08:00
|
|
|
};
|