Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use isInCall mixins in NewGroupConversation
This also fixes a discrepancy in the participant method where the token
check was mistakenly inverted so that a dummy disconnected participant
would be returned despite being in a call.

Signed-off-by: Vincent Petry <[email protected]>
  • Loading branch information
PVince81 committed Nov 26, 2020
commit 699df4b260cc681b9d7c8bcb6406100575e48fc7
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ import {
} from '../../../services/conversationsService'
import { generateUrl } from '@nextcloud/router'
import PasswordProtect from './PasswordProtect/PasswordProtect'
import { PARTICIPANT } from '../../../constants'
import isInCall from '../../../mixins/isInCall'
import participant from '../../../mixins/participant'
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip'

export default {
Expand All @@ -154,6 +155,11 @@ export default {
Plus,
},

mixins: [
isInCall,
participant,
],

data() {
return {
modal: false,
Expand Down Expand Up @@ -187,28 +193,6 @@ export default {
selectedParticipants() {
return this.$store.getters.selectedParticipants
},

participant() {
// TODO: use participant mixin ??
if (this.$store.getters.getToken()) {
return {
inCall: PARTICIPANT.CALL_FLAG.DISCONNECTED,
}
}

const participantIndex = this.$store.getters.getParticipantIndex(this.$store.getters.getToken(), this.$store.getters.getParticipantIdentifier())
if (participantIndex !== -1) {
return this.$store.getters.getParticipant(this.$store.getters.getToken(), participantIndex)
}

return {
inCall: PARTICIPANT.CALL_FLAG.DISCONNECTED,
}
},

isInCall() {
return this.participant.inCall !== PARTICIPANT.CALL_FLAG.DISCONNECTED
},
},

methods: {
Expand Down
9 changes: 5 additions & 4 deletions src/components/MessagesList/MessagesGroup/Message/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,18 @@ export default {
tooltip: Tooltip,
},

mixins: [
participant,
],

components: {
Actions,
ActionButton,
CallButton,
Quote,
RichText,
},

mixins: [
participant,
],

inheritAttrs: false,

props: {
Expand Down