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

fix(TopBarMenu): check capabilities for downloading participants in call #13629

Merged
merged 1 commit into from
Oct 25, 2024
Merged
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
8 changes: 6 additions & 2 deletions src/components/TopBar/TopBarMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
</template>
{{ t('spreed', 'Conversation settings') }}
</NcActionButton>
<NcActionLink v-if="isInCall && canModerate"
<NcActionLink v-if="isInCall && canDownloadCallParticipants"
DorraJaouad marked this conversation as resolved.
Show resolved Hide resolved
:href="downloadCallParticipantsLink"
target="_blank">
<template #icon>
Expand Down Expand Up @@ -189,7 +189,7 @@ import {
} from '../../composables/useDocumentFullscreen.ts'
import { useIsInCall } from '../../composables/useIsInCall.js'
import { CALL, CONVERSATION, PARTICIPANT } from '../../constants.js'
import { getTalkConfig } from '../../services/CapabilitiesManager.ts'
import { getTalkConfig, hasTalkFeature } from '../../services/CapabilitiesManager.ts'
import { useBreakoutRoomsStore } from '../../stores/breakoutRooms.ts'
import { useCallViewStore } from '../../stores/callView.js'
import { generateAbsoluteUrl } from '../../utils/handleUrl.ts'
Expand Down Expand Up @@ -381,6 +381,10 @@ export default {
return !this.callViewStore.isEmptyCallView
},
canDownloadCallParticipants() {
return hasTalkFeature(this.token, 'download-call-participants') && this.canModerate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return hasTalkFeature(this.token, 'download-call-participants') && this.canModerate
return hasTalkFeature(this.token, 'download-call-participants') && this.canModerate && this.isInCall

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to keep it separate so it's visible from the DOM that it's only used in call.

},
downloadCallParticipantsLink() {
return generateOcsUrl('apps/spreed/api/v4/call/{token}/download', { token: this.token })
},
Expand Down
Loading