Skip to content

Commit

Permalink
fix(signaling): add UI warning in call with 4+ participants
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Dec 18, 2024
1 parent bab0241 commit 2492498
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import debounce from 'debounce'
import { provide } from 'vue'

import { getCurrentUser } from '@nextcloud/auth'
import { showWarning } from '@nextcloud/dialogs'
import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
import { loadState } from '@nextcloud/initial-state'
import { t } from '@nextcloud/l10n'
import { generateUrl } from '@nextcloud/router'

Expand Down Expand Up @@ -197,6 +199,7 @@ export default {
EventBus.off('switch-to-conversation')
EventBus.off('conversations-received')
EventBus.off('forbidden-route')
EventBus.off('signaling-internal-show-warning', this.showSignalingInternalWarning)
},

beforeMount() {
Expand Down Expand Up @@ -333,6 +336,10 @@ export default {
}
})

if (loadState('spreed', 'signaling_mode') === 'internal') {
EventBus.on('signaling-internal-show-warning', this.showSignalingInternalWarning)
}

const beforeRouteChangeListener = (to, from, next) => {
if (this.isNextcloudTalkHashDirty) {
// Nextcloud Talk configuration changed, reload the page when changing configuration
Expand Down Expand Up @@ -615,7 +622,13 @@ export default {

// Breakout to breakout
return oldConversation.objectType === CONVERSATION.OBJECT_TYPE.BREAKOUT_ROOM && newConversation.objectType === CONVERSATION.OBJECT_TYPE.BREAKOUT_ROOM
}
},

showSignalingInternalWarning(token) {
if (this.$store.getters.isModerator || this.$store.getters.participantsList(token)?.length > 4) {
showWarning(t('spreed', 'Having a call with more than 4 participants without external signaling server can cause connectivity issues and cause high load on participating devices'))
}
},
},
}
</script>
Expand Down
1 change: 1 addition & 0 deletions src/FilesSidebarTabApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ export default {
// signaling server is used periodic polling has to be used
// instead.
OCA.Talk.fetchCurrentConversationIntervalId = window.setInterval(OCA.Talk.fetchCurrentConversationWrapper, 30000)
// TODO
}
},

Expand Down
1 change: 1 addition & 0 deletions src/PublicShareAuthSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export default {
// signaling server is used periodic polling has to be used
// instead.
this.fetchCurrentConversationIntervalId = window.setInterval(this.fetchCurrentConversation, 30000)
// TODO
}

if (currentUser || guestNickname) {
Expand Down
1 change: 1 addition & 0 deletions src/PublicShareSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export default {
// signaling server is used periodic polling has to be used
// instead.
this.fetchCurrentConversationIntervalId = window.setInterval(this.fetchCurrentConversation, 30000)
// TODO
}
},

Expand Down
8 changes: 8 additions & 0 deletions src/utils/signaling.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,14 @@ Signaling.Internal.prototype.sendPendingMessages = function() {
}.bind(this))
}

Signaling.Internal.prototype._joinCallSuccess = function(token) {
if (this.hideWarning) {
return
}

EventBus.emit('signaling-internal-show-warning', token)
}

/**
* @param {object} settings The signaling settings
* @param {string|string[]} urls The url of the signaling server
Expand Down

0 comments on commit 2492498

Please sign in to comment.