Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(capabilities): add sip-dialin-info capability #13659

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,4 @@
* `download-call-participants` - Whether the endpoints for moderators to download the call participants is available
* `config => call => start-without-media` (local) - Boolean, whether media should be disabled when starting or joining a conversation
* `config => call => max-duration` - Integer, maximum call duration in seconds. Please note that this should only be used with system cron and with a reasonable high value, due to the expended duration until the background job ran.
* `config => call => sip-dialin-info` - String, SIP dial-in information
1 change: 1 addition & 0 deletions lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ public function getCapabilities(): array {
// 'predefined-backgrounds' => list<string>,
'can-upload-background' => false,
'sip-enabled' => $this->talkConfig->isSIPConfigured(),
'sip-dialin-info' => $this->talkConfig->getDialInInfo(),
'sip-dialout-enabled' => $this->talkConfig->isSIPDialOutEnabled(),
'can-enable-sip' => false,
'start-without-media' => $this->talkConfig->getCallsStartWithoutMedia($user?->getUID()),
Expand Down
1 change: 1 addition & 0 deletions lib/ResponseDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@
* predefined-backgrounds: string[],
* can-upload-background: bool,
* sip-enabled: bool,
* sip-dialin-info: string,
* sip-dialout-enabled: bool,
* can-enable-sip: bool,
* start-without-media: bool,
Expand Down
5 changes: 0 additions & 5 deletions lib/TInitialState.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ protected function publishInitialStateShared(): void {
$this->talkConfig->getSignalingMode()
);

$this->initialState->provideInitialState(
'sip_dialin_info',
$this->talkConfig->getDialInInfo()
);

$this->initialState->provideInitialState(
'grid_videos_limit',
$this->talkConfig->getGridVideosLimit()
Expand Down
1 change: 1 addition & 0 deletions src/components/RightSidebar/RightSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
</template>
<SetGuestUsername v-if="!getUserId" />
<SipSettings v-if="showSIPSettings"
:token="token"
:meeting-id="conversation.token"
:attendee-pin="conversation.attendeePin" />
<div v-if="!getUserId" id="app-settings">
Expand Down
18 changes: 10 additions & 8 deletions src/components/RightSidebar/SipSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@
</template>

<script>
import { loadState } from '@nextcloud/initial-state'
import { t } from '@nextcloud/l10n'

import { getTalkConfig } from '../../services/CapabilitiesManager.ts'
import { readableNumber } from '../../utils/readableNumber.ts'

export default {
name: 'SipSettings',

props: {
token: {
type: String,
required: true,
},
attendeePin: {
type: String,
required: true,
Expand All @@ -36,16 +40,14 @@ export default {
},
},

data() {
setup() {
const dialInInfo = getTalkConfig(token, 'call', 'sip_dialin_info')
return {
dialInInfo: loadState('spreed', 'sip_dialin_info'),
dialInInfo,
t,
readableNumber,
}
},

methods: {
t,
readableNumber,
}
}
</script>

Expand Down
2 changes: 2 additions & 0 deletions tests/php/CapabilitiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public function testGetCapabilitiesGuest(): void {
'supported-reactions' => ['❤️', '🎉', '👏', '👋', '👍', '👎', '🔥', '😂', '🤩', '🤔', '😲', '😥'],
'can-upload-background' => false,
'sip-enabled' => false,
'sip-dialin-info' => '',
'sip-dialout-enabled' => false,
'can-enable-sip' => false,
'start-without-media' => false,
Expand Down Expand Up @@ -252,6 +253,7 @@ public function testGetCapabilitiesUserAllowed(bool $isNotAllowed, bool $canCrea
'supported-reactions' => ['❤️', '🎉', '👏', '👋', '👍', '👎', '🔥', '😂', '🤩', '🤔', '😲', '😥'],
'can-upload-background' => $canUpload,
'sip-enabled' => false,
'sip-dialin-info' => '',
'sip-dialout-enabled' => false,
'can-enable-sip' => false,
'start-without-media' => false,
Expand Down
Loading