Browse Source

Add services

Signed-off-by: marco <marcoambrosini@pm.me>
pull/6382/head
marco 4 years ago
committed by Joas Schilling
parent
commit
48132b305a
No known key found for this signature in database GPG Key ID: 7076EA9751AACDDA
  1. 33
      src/services/conversationsService.js

33
src/services/conversationsService.js

@ -354,6 +354,37 @@ const setConversationDescription = async function(token, description) {
return response
}
/**
* Set the default permissions for participants in a conversation.
*
* @param {string} token conversation token
* @param {number} permissions the type of permission to be granted. Valid values are
* any sums of 'DEFAULT', 'CUSTOM', 'CALL_START', 'CALL_JOIN', 'LOBBY_IGNORE',
* 'PUBLISH_AUDIO', 'PUBLISH_VIDEO', 'PUBLISH_SCREEN'.
*/
const setConversationPermissions = async (token, permissions) => {
await axios.put(generateOcsUrl('apps/spreed/api/v4/room/{token}/permissions/default', { token }),
{
permissions,
})
}
/**
* Set the default permissions for participants in a call. These will be reset
* to default once the call has ended.
*
* @param {string} token conversation token
* @param {number} permissions the type of permission to be granted. Valid values are
* any sums of 'DEFAULT', 'CUSTOM', 'CALL_START', 'CALL_JOIN', 'LOBBY_IGNORE',
* 'PUBLISH_AUDIO', 'PUBLISH_VIDEO', 'PUBLISH_SCREEN'.
*/
const setCallPermissions = async (token, permissions) => {
await axios.put(generateOcsUrl('apps/spreed/api/v4/room/{token}/permissions/call', { token }),
{
permissions,
})
}
export {
fetchConversations,
fetchConversation,
@ -378,4 +409,6 @@ export {
setConversationName,
setConversationDescription,
clearConversationHistory,
setConversationPermissions,
setCallPermissions,
}
Loading…
Cancel
Save