Skip to content
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
408 changes: 269 additions & 139 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"devDependencies": {
"@nextcloud/babel-config": "^1.0.0",
"@nextcloud/browserslist-config": "^2.1.0",
"@nextcloud/eslint-config": "^5.1.0",
"@nextcloud/eslint-config": "^6.1.0",
"@nextcloud/stylelint-config": "^1.0.0-beta.0",
"@nextcloud/webpack-vue-config": "^4.1.0",
"@vue/cli-plugin-unit-jest": "^4.5.13",
Expand Down
34 changes: 20 additions & 14 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ export default {

/**
* Keeps a list for all last message ids
* @returns {object} Map with token => lastMessageId
*
* @return {object} Map with token => lastMessageId
*/
lastMessageMap() {
const conversationList = this.$store.getters.conversationsList
Expand Down Expand Up @@ -151,7 +152,7 @@ export default {
},

/**
* @returns {boolean} Returns true, if
* @return {boolean} Returns true, if
* - a conversation is newly added to lastMessageMap
* - a conversation has a different last message id then previously
*/
Expand All @@ -170,23 +171,26 @@ export default {

/**
* The current conversation token
* @returns {string} The token.
*
* @return {string} The token.
*/
token() {
return this.$store.getters.getToken()
},

/**
* The current conversation
* @returns {object} The conversation object.
*
* @return {object} The conversation object.
*/
currentConversation() {
return this.$store.getters.conversation(this.token)
},

/**
* Computes whether the current conversation is one to one
* @returns {boolean} The result
*
* @return {boolean} The result
*/
isOneToOne() {
return this.currentConversation?.type === CONVERSATION.TYPE.ONE_TO_ONE
Expand Down Expand Up @@ -214,17 +218,17 @@ export default {

beforeDestroy() {
if (!getCurrentUser()) {
EventBus.$off('shouldRefreshConversations', this.debounceRefreshCurrentConversation)
EventBus.$off('should-refresh-conversations', this.debounceRefreshCurrentConversation)
}
document.removeEventListener('visibilitychange', this.changeWindowVisibility)
},

beforeMount() {
if (!getCurrentUser()) {
EventBus.$once('joinedConversation', () => {
EventBus.$once('joined-conversation', () => {
this.fixmeDelayedSetupOfGuestUsers()
})
EventBus.$on('shouldRefreshConversations', this.debounceRefreshCurrentConversation)
EventBus.$on('should-refresh-conversations', this.debounceRefreshCurrentConversation)
}

if (this.$route.name === 'conversation') {
Expand All @@ -251,7 +255,7 @@ export default {
}
})

EventBus.$on('conversationsReceived', (params) => {
EventBus.$on('conversations-received', (params) => {
if (this.$route.name === 'conversation'
&& !this.$store.getters.conversation(this.token)) {
if (!params.singleConversation) {
Expand All @@ -270,7 +274,7 @@ export default {
* component each time a new batch of conversations is received and processed in
* the store.
*/
EventBus.$once('conversationsReceived', () => {
EventBus.$once('conversations-received', () => {
if (this.$route.name === 'conversation') {
// Adjust the page title once the conversation list is loaded
this.setPageTitle(this.getConversationName(this.token), false)
Expand Down Expand Up @@ -309,14 +313,14 @@ export default {
* Fires a global event that tells the whole app that the route has changed. The event
* carries the from and to objects as payload
*/
EventBus.$emit('routeChange', { from, to })
EventBus.$emit('route-change', { from, to })

next()
}

/**
* Global before guard, this is called whenever a navigation is triggered.
*/
*/
Router.beforeEach((to, from, next) => {
if (this.warnLeaving && !to.params?.skipLeaveWarning) {
OC.dialogs.confirmDestructive(
Expand Down Expand Up @@ -403,6 +407,7 @@ export default {

/**
* Set the page title to the conversation name
*
* @param {string} title Prefix for the page title e.g. conversation name
* @param {boolean} showAsterix Prefix for the page title e.g. conversation name
*/
Expand Down Expand Up @@ -438,8 +443,9 @@ export default {

/**
* Get a conversation's name.
*
* @param {string} token The conversation's token
* @returns {string} The conversation's name
* @return {string} The conversation's name
*/
getConversationName(token) {
if (!this.$store.getters.conversation(token)) {
Expand All @@ -462,7 +468,7 @@ export default {
* Emits a global event that is used in App.vue to update the page title once the
* ( if the current route is a conversation and once the conversations are received)
*/
EventBus.$emit('conversationsReceived', {
EventBus.$emit('conversations-received', {
singleConversation: true,
})
} catch (exception) {
Expand Down
4 changes: 2 additions & 2 deletions src/FilesSidebarCallViewApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default {
* Note that false is returned too when the sidebar is closed, even if
* the conversation is active in the current file.
*
* @returns {Boolean} true if the sidebar is opened in the file, false
* @return {boolean} true if the sidebar is opened in the file, false
* otherwise.
*/
isInFile() {
Expand Down Expand Up @@ -130,7 +130,7 @@ export default {
* when the FileInfo has been set and it does not match the current
* conversation.
*
* @param {Object} fileInfo the watched FileInfo
* @param {object} fileInfo the watched FileInfo
*/
fileInfo(fileInfo) {
if (!fileInfo) {
Expand Down
10 changes: 5 additions & 5 deletions src/FilesSidebarTabApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ export default {
// "inCall" flag (which is locally updated when joining and leaving
// a call) is currently used.
if (loadState('spreed', 'signaling_mode') !== 'internal') {
EventBus.$on('shouldRefreshConversations', OCA.Talk.fetchCurrentConversationWrapper)
EventBus.$on('Signaling::participantListChanged', OCA.Talk.fetchCurrentConversationWrapper)
EventBus.$on('should-refresh-conversations', OCA.Talk.fetchCurrentConversationWrapper)
EventBus.$on('signaling-participant-list-changed', OCA.Talk.fetchCurrentConversationWrapper)
} else {
// The "shouldRefreshConversations" event is triggered only when
// The "should-refresh-conversations" event is triggered only when
// the external signaling server is used; when the internal
// signaling server is used periodic polling has to be used
// instead.
Expand All @@ -212,8 +212,8 @@ export default {
},

leaveConversation() {
EventBus.$off('shouldRefreshConversations', OCA.Talk.fetchCurrentConversationWrapper)
EventBus.$off('Signaling::participantListChanged', OCA.Talk.fetchCurrentConversationWrapper)
EventBus.$off('should-refresh-conversations', OCA.Talk.fetchCurrentConversationWrapper)
EventBus.$off('signaling-participant-list-changed', OCA.Talk.fetchCurrentConversationWrapper)
window.clearInterval(OCA.Talk.fetchCurrentConversationIntervalId)

// TODO: move to store under a special action ?
Expand Down
6 changes: 3 additions & 3 deletions src/PublicShareAuthSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ export default {
// "inCall" flag (which is locally updated when joining and leaving
// a call) is currently used.
if (loadState('spreed', 'signaling_mode') !== 'internal') {
EventBus.$on('shouldRefreshConversations', this.fetchCurrentConversation)
EventBus.$on('Signaling::participantListChanged', this.fetchCurrentConversation)
EventBus.$on('should-refresh-conversations', this.fetchCurrentConversation)
EventBus.$on('signaling-participant-list-changed', this.fetchCurrentConversation)
} else {
// The "shouldRefreshConversations" event is triggered only when
// The "should-refresh-conversations" event is triggered only when
// the external signaling server is used; when the internal
// signaling server is used periodic polling has to be used
// instead.
Expand Down
6 changes: 3 additions & 3 deletions src/PublicShareSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ export default {
// "inCall" flag (which is locally updated when joining and leaving
// a call) is currently used.
if (loadState('spreed', 'signaling_mode') !== 'internal') {
EventBus.$on('shouldRefreshConversations', this.fetchCurrentConversation)
EventBus.$on('Signaling::participantListChanged', this.fetchCurrentConversation)
EventBus.$on('should-refresh-conversations', this.fetchCurrentConversation)
EventBus.$on('signaling-participant-list-changed', this.fetchCurrentConversation)
} else {
// The "shouldRefreshConversations" event is triggered only when
// The "should-refresh-conversations" event is triggered only when
// the external signaling server is used; when the internal
// signaling server is used periodic polling has to be used
// instead.
Expand Down
2 changes: 1 addition & 1 deletion src/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @author Julius Härtl <[email protected]>
*
* @license GNU AGPL version 3 or any later version
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdminSettings/SignalingServer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default {

methods: {
removeServer() {
this.$emit('removeServer', this.index)
this.$emit('remove-server', this.index)
},
updateServer(event) {
this.$emit('update:server', event.target.value)
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdminSettings/SignalingServers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
:verify.sync="servers[index].verify"
:index="index"
:loading="loading"
@removeServer="removeServer"
@remove-server="removeServer"
@update:server="debounceUpdateServers"
@update:verify="debounceUpdateServers" />
</transition-group>
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdminSettings/StunServer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default {

methods: {
removeServer() {
this.$emit('removeServer', this.index)
this.$emit('remove-server', this.index)
},
update(event) {
this.$emit('update:server', event.target.value)
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdminSettings/StunServers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
:server.sync="servers[index]"
:index="index"
:loading="loading"
@removeServer="removeServer"
@remove-server="removeServer"
@update:server="debounceUpdateServers" />
</transition-group>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdminSettings/TurnServer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export default {
},

removeServer() {
this.$emit('removeServer', this.index)
this.$emit('remove-server', this.index)
},
updateSchemes(event) {
this.$emit('update:schemes', event.target.value)
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdminSettings/TurnServers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
:protocols.sync="servers[index].protocols"
:index="index"
:loading="loading"
@removeServer="removeServer"
@remove-server="removeServer"
@update:schemes="debounceUpdateServers"
@update:server="debounceUpdateServers"
@update:secret="debounceUpdateServers"
Expand Down
4 changes: 2 additions & 2 deletions src/components/CallView/CallView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,14 @@ export default {
this.updateDataFromCallParticipantModels(this.callParticipantModels)
},
mounted() {
EventBus.$on('refreshPeerList', this.debounceFetchPeers)
EventBus.$on('refresh-peer-list', this.debounceFetchPeers)

callParticipantCollection.on('remove', this._lowerHandWhenParticipantLeaves)

subscribe('talk:video:toggled', this.handleToggleVideo)
},
beforeDestroy() {
EventBus.$off('refreshPeerList', this.debounceFetchPeers)
EventBus.$off('refresh-peer-list', this.debounceFetchPeers)

callParticipantCollection.off('remove', this._lowerHandWhenParticipantLeaves)

Expand Down
2 changes: 1 addition & 1 deletion src/components/CallView/shared/Video.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export default {
peerData() {
let peerData = this.$store.getters.getPeer(this.$store.getters.getToken(), this.peerId)
if (!peerData.actorId) {
EventBus.$emit('refreshPeerList')
EventBus.$emit('refresh-peer-list')
peerData = {
actorType: '',
actorId: '',
Expand Down
7 changes: 7 additions & 0 deletions src/components/CallView/shared/VideoBackground.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ import { getBuilder } from '@nextcloud/browser-storage'
const browserStorage = getBuilder('nextcloud').persist().build()

// note: this info is shared with the Avatar component
/**
* @param userId
*/
function getUserHasAvatar(userId) {
const flag = browserStorage.getItem('user-has-avatar.' + userId)
if (typeof flag === 'string') {
Expand All @@ -48,6 +51,10 @@ function getUserHasAvatar(userId) {
return null
}

/**
* @param userId
* @param flag
*/
function setUserHasAvatar(userId, flag) {
browserStorage.setItem('user-has-avatar.' + userId, flag)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ChatView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
:is-chat-scrolled-to-bottom="isChatScrolledToBottom"
:token="token"
:is-visible="isVisible"
@setChatScrolledToBottom="setScrollStatus" />
@set-chat-scrolled-to-bottom="setScrollStatus" />
<NewMessageForm
role="region"
:is-chat-scrolled-to-bottom="isChatScrolledToBottom"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
:editing="isEditingDescription"
:loading="isDescriptionLoading"
:placeholder="t('spreed', 'Enter a description for this conversation')"
@submit:description="handleUpdateDescription"
@submit-description="handleUpdateDescription"
@update:editing="handleEditDescription" />
</AppSettingsSection>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export default {
methods: {
/**
* Set the notification level for the conversation
*
* @param {int} notificationLevel The notification level to set.
*/
async setNotificationLevel(notificationLevel) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Description/Description.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export default {
// Remove leading/trailing whitespaces.
this.descriptionText = this.descriptionText.replace(/\r\n|\n|\r/gm, '\n').trim()
// Submit description
this.$emit('submit:description', this.descriptionText)
this.$emit('submit-description', this.descriptionText)
/**
* Change the richcontenteditable key in order to trigger a re-render
* without this all the trimmed new lines and whitespaces would
Expand Down
Loading