зеркало из https://github.com/nextcloud/spreed.git
Return SIP and attendee information when interacting with rooms API
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Родитель
178a14e3cb
Коммит
21194ecb64
|
@ -129,7 +129,7 @@ const searchPossibleConversations = async function(searchText, token, onlyUsers)
|
|||
*/
|
||||
const createOneToOneConversation = async function(userId) {
|
||||
try {
|
||||
const response = await axios.post(generateOcsUrl('apps/spreed/api/v2', 2) + `room`, { roomType: CONVERSATION.TYPE.ONE_TO_ONE, invite: userId })
|
||||
const response = await axios.post(generateOcsUrl('apps/spreed/api/v3', 2) + `room`, { roomType: CONVERSATION.TYPE.ONE_TO_ONE, invite: userId })
|
||||
return response
|
||||
} catch (error) {
|
||||
console.debug('Error creating new one to one conversation: ', error)
|
||||
|
@ -143,7 +143,7 @@ const createOneToOneConversation = async function(userId) {
|
|||
*/
|
||||
const createGroupConversation = async function(invite, source) {
|
||||
try {
|
||||
const response = await axios.post(generateOcsUrl('apps/spreed/api/v2', 2) + `room`, { roomType: CONVERSATION.TYPE.GROUP, invite, source: source || 'groups' })
|
||||
const response = await axios.post(generateOcsUrl('apps/spreed/api/v3', 2) + `room`, { roomType: CONVERSATION.TYPE.GROUP, invite, source: source || 'groups' })
|
||||
return response
|
||||
} catch (error) {
|
||||
console.debug('Error creating new group conversation: ', error)
|
||||
|
@ -156,7 +156,7 @@ const createGroupConversation = async function(invite, source) {
|
|||
*/
|
||||
const createPrivateConversation = async function(conversationName) {
|
||||
try {
|
||||
const response = await axios.post(generateOcsUrl('apps/spreed/api/v2', 2) + `room`, { roomType: CONVERSATION.TYPE.GROUP, roomName: conversationName })
|
||||
const response = await axios.post(generateOcsUrl('apps/spreed/api/v3', 2) + `room`, { roomType: CONVERSATION.TYPE.GROUP, roomName: conversationName })
|
||||
return response
|
||||
} catch (error) {
|
||||
console.debug('Error creating new private conversation: ', error)
|
||||
|
@ -169,7 +169,7 @@ const createPrivateConversation = async function(conversationName) {
|
|||
*/
|
||||
const createPublicConversation = async function(conversationName) {
|
||||
try {
|
||||
const response = await axios.post(generateOcsUrl('apps/spreed/api/v2', 2) + `room`, { roomType: CONVERSATION.TYPE.PUBLIC, roomName: conversationName })
|
||||
const response = await axios.post(generateOcsUrl('apps/spreed/api/v3', 2) + `room`, { roomType: CONVERSATION.TYPE.PUBLIC, roomName: conversationName })
|
||||
return response
|
||||
} catch (error) {
|
||||
console.debug('Error creating new public conversation: ', error)
|
||||
|
@ -182,7 +182,7 @@ const createPublicConversation = async function(conversationName) {
|
|||
* @param {string} password the password to be set
|
||||
*/
|
||||
const setConversationPassword = async function(token, password) {
|
||||
const response = await axios.put(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/password`, {
|
||||
const response = await axios.put(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/password`, {
|
||||
password,
|
||||
})
|
||||
return response
|
||||
|
@ -194,7 +194,7 @@ const setConversationPassword = async function(token, password) {
|
|||
* @param {string} name the name to be set
|
||||
*/
|
||||
const setConversationName = async function(token, name) {
|
||||
const response = await axios.put(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}`, {
|
||||
const response = await axios.put(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}`, {
|
||||
roomName: name,
|
||||
})
|
||||
return response
|
||||
|
@ -206,7 +206,7 @@ const setConversationName = async function(token, name) {
|
|||
*/
|
||||
const deleteConversation = async function(token) {
|
||||
try {
|
||||
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}`)
|
||||
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}`)
|
||||
return response
|
||||
} catch (error) {
|
||||
console.debug('Error while deleting the conversation: ', error)
|
||||
|
@ -219,7 +219,7 @@ const deleteConversation = async function(token) {
|
|||
*/
|
||||
const addToFavorites = async function(token) {
|
||||
try {
|
||||
const response = await axios.post(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/favorite`)
|
||||
const response = await axios.post(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/favorite`)
|
||||
return response
|
||||
} catch (error) {
|
||||
console.debug('Error while adding the conversation to favorites: ', error)
|
||||
|
@ -232,7 +232,7 @@ const addToFavorites = async function(token) {
|
|||
*/
|
||||
const removeFromFavorites = async function(token) {
|
||||
try {
|
||||
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/favorite`)
|
||||
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/favorite`)
|
||||
return response
|
||||
} catch (error) {
|
||||
console.debug('Error while removing the conversation from favorites: ', error)
|
||||
|
@ -246,7 +246,7 @@ const removeFromFavorites = async function(token) {
|
|||
*/
|
||||
const setNotificationLevel = async function(token, level) {
|
||||
try {
|
||||
const response = await axios.post(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/notify`, { level })
|
||||
const response = await axios.post(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/notify`, { level })
|
||||
return response
|
||||
} catch (error) {
|
||||
console.debug('Error while setting the notification level: ', error)
|
||||
|
@ -259,7 +259,7 @@ const setNotificationLevel = async function(token, level) {
|
|||
*/
|
||||
const makePublic = async function(token) {
|
||||
try {
|
||||
const response = await axios.post(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/public`)
|
||||
const response = await axios.post(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/public`)
|
||||
return response
|
||||
} catch (error) {
|
||||
console.debug('Error while making the conversation public: ', error)
|
||||
|
@ -272,7 +272,7 @@ const makePublic = async function(token) {
|
|||
*/
|
||||
const makePrivate = async function(token) {
|
||||
try {
|
||||
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/public`)
|
||||
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/public`)
|
||||
return response
|
||||
} catch (error) {
|
||||
console.debug('Error while making the conversation private: ', error)
|
||||
|
@ -285,7 +285,7 @@ const makePrivate = async function(token) {
|
|||
* @param {int} newState The new SIP state to set
|
||||
*/
|
||||
const setSIPEnabled = async function(token, newState) {
|
||||
return axios.put(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/webinar/sip`, {
|
||||
return axios.put(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/webinar/sip`, {
|
||||
state: newState,
|
||||
})
|
||||
}
|
||||
|
@ -298,7 +298,7 @@ const setSIPEnabled = async function(token, newState) {
|
|||
*/
|
||||
const changeLobbyState = async function(token, newState, timestamp) {
|
||||
try {
|
||||
const response = await axios.put(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/webinar/lobby`, {
|
||||
const response = await axios.put(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/webinar/lobby`, {
|
||||
state: newState,
|
||||
timer: timestamp,
|
||||
})
|
||||
|
@ -315,7 +315,7 @@ const changeLobbyState = async function(token, newState, timestamp) {
|
|||
*/
|
||||
const changeReadOnlyState = async function(token, readOnly) {
|
||||
try {
|
||||
const response = await axios.put(generateOcsUrl('apps/spreed/api/v2', 2) + `room/${token}/read-only`, {
|
||||
const response = await axios.put(generateOcsUrl('apps/spreed/api/v3', 2) + `room/${token}/read-only`, {
|
||||
state: readOnly,
|
||||
})
|
||||
return response
|
||||
|
|
Загрузка…
Ссылка в новой задаче