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 using signaling session ID instead of Nextcloud session ID #12961

Merged
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
20 changes: 0 additions & 20 deletions src/components/CallView/shared/LocalVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
</template>

<script>
import Hex from 'crypto-js/enc-hex.js'
import SHA1 from 'crypto-js/sha1.js'

import { showError, showInfo, TOAST_PERMANENT_TIMEOUT } from '@nextcloud/dialogs'
import { t } from '@nextcloud/l10n'

Expand All @@ -62,7 +59,6 @@ import VideoBackground from './VideoBackground.vue'
import AvatarWrapper from '../../AvatarWrapper/AvatarWrapper.vue'

import { AVATAR } from '../../../constants.js'
import { useGuestNameStore } from '../../../stores/guestName.js'
danxuliu marked this conversation as resolved.
Show resolved Hide resolved
import attachMediaStream from '../../../utils/attachmediastream.js'
import { ConnectionState } from '../../../utils/webrtc/models/CallParticipantModel.js'

Expand Down Expand Up @@ -126,11 +122,6 @@ export default {

emits: ['click-video'],

setup() {
const guestNameStore = useGuestNameStore()
return { guestNameStore }
},

data() {
return {
notificationHandle: null,
Expand Down Expand Up @@ -187,17 +178,6 @@ export default {
return this.$store.getters.getDisplayName()
},

sessionHash() {
return Hex.stringify(SHA1(this.localCallParticipantModel.attributes.peerId))
},

guestName() {
return this.guestNameStore.getGuestName(
this.$store.getters.getToken(),
this.sessionHash,
)
},
Antreesy marked this conversation as resolved.
Show resolved Hide resolved

avatarSize() {
if (this.isStripe || (!this.isBig && !this.isGrid)) {
return AVATAR.SIZE.LARGE
Expand Down
6 changes: 3 additions & 3 deletions src/components/CallView/shared/ReactionToaster.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,17 @@ export default {
},

getParticipantName(model) {
const { name, peerId } = model.attributes
const { name, nextcloudSessionId } = model.attributes
if (name) {
return name
}

const participant = this.participants.find(participant => participant.sessionIds.includes(peerId))
const participant = this.participants.find(participant => participant.sessionIds.includes(nextcloudSessionId))
if (participant?.displayName) {
return participant.displayName
}

return this.guestNameStore.getGuestName(this.token, Hex.stringify(SHA1(peerId)))
return this.guestNameStore.getGuestName(this.token, Hex.stringify(SHA1(nextcloudSessionId)))
},

getReactionURL(emoji) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/CallView/shared/Screen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default {
return null
}

return Hex.stringify(SHA1(this.callParticipantModel.attributes.peerId))
return Hex.stringify(SHA1(this.callParticipantModel.attributes.nextcloudSessionId))
},

remoteParticipantName() {
Expand Down
10 changes: 7 additions & 3 deletions src/components/CallView/shared/VideoVue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,11 @@ export default {
},

sessionHash() {
return Hex.stringify(SHA1(this.peerId))
return Hex.stringify(SHA1(this.nextcloudSessionId))
},

peerData() {
let peerData = this.$store.getters.getPeer(this.$store.getters.getToken(), this.peerId, this.model.attributes.userId)
let peerData = this.$store.getters.getPeer(this.$store.getters.getToken(), this.nextcloudSessionId, this.model.attributes.userId)
Antreesy marked this conversation as resolved.
Show resolved Hide resolved
if (!peerData.actorId) {
EventBus.emit('refresh-peer-list')
peerData = {
Expand All @@ -352,7 +352,7 @@ export default {
* via the participant list
*/
return this.$store.getters.findParticipant(this.$store.getters.getToken(), {
sessionId: this.peerId,
sessionId: this.nextcloudSessionId,
}) || {}
},

Expand Down Expand Up @@ -514,6 +514,10 @@ export default {
peerId() {
return this.model.attributes.peerId
},

nextcloudSessionId() {
return this.model.attributes.nextcloudSessionId
},
},

watch: {
Expand Down
Loading