@@ -57,7 +57,6 @@ import type {
5757
5858import axios from '@nextcloud/axios'
5959import { generateOcsUrl } from '@nextcloud/router'
60- import { hasTalkFeature } from './CapabilitiesManager.ts'
6160
6261/**
6362 * Fetches all conversations from the server.
@@ -289,10 +288,19 @@ async function setNotificationCalls(token: string, level: setConversationNotifyC
289288 * @param password The password to set for the conversation (optional, only if force password is enabled)
290289 */
291290async function makeConversationPublic ( token : string , password : makeConversationPublicParams [ 'password' ] ) : makeConversationPublicResponse {
292- const data = ( hasTalkFeature ( token , 'conversation-creation-password' ) && password )
293- ? { password }
294- : undefined
295- return axios . post ( generateOcsUrl ( 'apps/spreed/api/v4/room/{token}/public' , { token } ) , data as makeConversationPublicParams )
291+ return axios . post ( generateOcsUrl ( 'apps/spreed/api/v4/room/{token}/public' , { token } ) , {
292+ password,
293+ } as makeConversationPublicParams )
294+ }
295+
296+ /**
297+ * Make the conversation public (legacy method, doesn't support password payload)
298+ * Capability check for 'conversation-creation-password'
299+ *
300+ * @param token The token of the conversation to be removed from favorites
301+ */
302+ async function makeLegacyConversationPublic ( token : string ) : makeConversationPublicResponse {
303+ return axios . post ( generateOcsUrl ( 'apps/spreed/api/v4/room/{token}/public' , { token } ) )
296304}
297305
298306/**
@@ -433,6 +441,7 @@ export {
433441 fetchNoteToSelfConversation ,
434442 makeConversationPrivate ,
435443 makeConversationPublic ,
444+ makeLegacyConversationPublic ,
436445 markAsImportant ,
437446 markAsInsensitive ,
438447 markAsSensitive ,
0 commit comments