summaryrefslogtreecommitdiffstats
path: root/src/components/CallView
diff options
context:
space:
mode:
authorMaksim Sukharev <antreesy.web@gmail.com>2023-04-20 16:19:41 +0200
committerMaksim Sukharev <antreesy.web@gmail.com>2023-04-20 16:19:41 +0200
commitd3adefe2477426739094254543389550d15aaa3b (patch)
tree07e20941a838218a19e0a48c6c4988b0cc3e3a14 /src/components/CallView
parent4e4782312d497ac8f239c046aa75aa1ce5ab4005 (diff)
move capabilities request to HOC
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Diffstat (limited to 'src/components/CallView')
-rw-r--r--src/components/CallView/CallView.vue9
-rw-r--r--src/components/CallView/shared/ReactionToaster.vue15
2 files changed, 23 insertions, 1 deletions
diff --git a/src/components/CallView/CallView.vue b/src/components/CallView/CallView.vue
index bab63925a..01afdf043 100644
--- a/src/components/CallView/CallView.vue
+++ b/src/components/CallView/CallView.vue
@@ -121,7 +121,9 @@
@select-video="handleSelectVideo"
@click-local-video="handleClickLocalVideo" />
- <ReactionToaster :token="token"
+ <ReactionToaster v-if="supportedReactions?.length"
+ :token="token"
+ :supported-reactions="supportedReactions"
:call-participant-models="callParticipantModels" />
<!-- Local video if sidebar -->
@@ -145,6 +147,7 @@
<script>
import debounce from 'debounce'
+import { getCapabilities } from '@nextcloud/capabilities'
import { showMessage } from '@nextcloud/dialogs'
import { subscribe, unsubscribe } from '@nextcloud/event-bus'
import { loadState } from '@nextcloud/initial-state'
@@ -343,6 +346,10 @@ export default {
return null
},
+
+ supportedReactions() {
+ return getCapabilities()?.spreed?.config?.call?.['supported-reactions']
+ },
},
watch: {
localScreen(localScreen) {
diff --git a/src/components/CallView/shared/ReactionToaster.vue b/src/components/CallView/shared/ReactionToaster.vue
index 4afa528d5..8d0a8ccd7 100644
--- a/src/components/CallView/shared/ReactionToaster.vue
+++ b/src/components/CallView/shared/ReactionToaster.vue
@@ -54,6 +54,16 @@ export default {
type: String,
required: true,
},
+
+ /**
+ * Supported reactions
+ */
+ supportedReactions: {
+ type: Array,
+ validator: (prop) => prop.every(e => typeof e === 'string'),
+ required: true,
+ },
+
callParticipantModels: {
type: Array,
required: true,
@@ -110,6 +120,11 @@ export default {
},
handleReaction(model, reaction) {
+ // prevent receiving anything rather than defined reactions in capabilities
+ if (!this.supportedReactions.includes(reaction)) {
+ return
+ }
+
this.reactionsQueue.push({
reaction,
name: this.getParticipantName(model),