Class MessageParticipants

Sends a direct message to a participant if certain conditions are met.

This method checks the current user's level and their co-host responsibilities to determine if they are allowed to send a direct message to a specified participant. If the user has the appropriate permissions, the method updates the direct message details and opens the messages modal. If the user is not allowed to send the message, an alert is displayed.

The options for sending a message to a participant.

Array of responsibilities assigned to the co-host.

The participant to whom the message is to be sent.

The current member attempting to send the message.

The level of the current member.

Function to show an alert message if the message cannot be sent.

The co-host member.

Function to update the visibility of the messages modal.

Function to update the details of the direct message.

Function to start the direct message.

const messageService = new MessageParticipants();
messageService.messageParticipants({
coHostResponsibility: [{ name: 'chat', value: true }],
participant: { name: 'John', islevel: '1' },
member: 'Alice',
islevel: '1',
showAlert: ({ message, type, duration }) => {
console.log(`Alert: ${message} - Type: ${type} - Duration: ${duration}`);
},
coHost: 'Bob',
updateIsMessagesModalVisible: (isVisible) => {
console.log(`Messages modal is now ${isVisible ? 'visible' : 'hidden'}`);
},
updateDirectMessageDetails: (participant) => {
console.log(`Direct messaging: ${participant.name}`);
},
updateStartDirectMessage: (start) => {
console.log(`Direct messaging started: ${start}`);
},
});

Constructors

Methods

Constructors

Methods