mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
chore(ts): migrate actor store to ts
Signed-off-by: Dorra Jaouad <dorra.jaoued7@gmail.com>
This commit is contained in:
parent
688592e938
commit
d5d2ad0cf9
64 changed files with 128 additions and 117 deletions
12
src/App.vue
12
src/App.vue
|
|
@ -47,7 +47,7 @@ import Router from './router/router.ts'
|
|||
import BrowserStorage from './services/BrowserStorage.js'
|
||||
import { EventBus } from './services/EventBus.ts'
|
||||
import { leaveConversationSync } from './services/participantsService.js'
|
||||
import { useActorStore } from './stores/actor.js'
|
||||
import { useActorStore } from './stores/actor.ts'
|
||||
import { useCallViewStore } from './stores/callView.ts'
|
||||
import { useFederationStore } from './stores/federation.ts'
|
||||
import { useSidebarStore } from './stores/sidebar.ts'
|
||||
|
|
@ -325,7 +325,7 @@ export default {
|
|||
|
||||
const payload = {
|
||||
token: params.token,
|
||||
participantIdentifier: this.actorStore.getParticipantIdentifier,
|
||||
participantIdentifier: this.actorStore.participantIdentifier,
|
||||
flags,
|
||||
silent: true,
|
||||
recordingConsent: this.recordingConsentGiven,
|
||||
|
|
@ -442,14 +442,6 @@ export default {
|
|||
})
|
||||
}
|
||||
})
|
||||
|
||||
if (getCurrentUser()) {
|
||||
console.debug('Setting current user')
|
||||
this.actorStore.setCurrentUser(getCurrentUser())
|
||||
this.actorStore.getCurrentUserTeams()
|
||||
} else {
|
||||
console.debug('Can not set current user because it\'s a guest')
|
||||
}
|
||||
},
|
||||
|
||||
async mounted() {
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@ import { getFileConversation } from './services/filesIntegrationServices.js'
|
|||
import {
|
||||
leaveConversationSync,
|
||||
} from './services/participantsService.js'
|
||||
import { useActorStore } from './stores/actor.ts'
|
||||
import { checkBrowser } from './utils/browserCheck.ts'
|
||||
import CancelableRequest from './utils/cancelableRequest.js'
|
||||
import { signalingKill } from './utils/webrtc/index.js'
|
||||
import { useActorStore } from './stores/actor.js'
|
||||
|
||||
export default {
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ export default {
|
|||
},
|
||||
|
||||
beforeMount() {
|
||||
this.actorStore.setCurrentUse(getCurrentUser())
|
||||
this.actorStore.setCurrentUser(getCurrentUser())
|
||||
|
||||
window.addEventListener('unload', () => {
|
||||
console.info('Navigating away, leaving conversation')
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ import {
|
|||
leaveConversationSync,
|
||||
setGuestUserName,
|
||||
} from './services/participantsService.js'
|
||||
import { useActorStore } from './stores/actor.js'
|
||||
import { useActorStore } from './stores/actor.ts'
|
||||
import { signalingKill } from './utils/webrtc/index.js'
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ import { getPublicShareConversationData } from './services/filesIntegrationServi
|
|||
import {
|
||||
leaveConversationSync,
|
||||
} from './services/participantsService.js'
|
||||
import { useActorStore } from './stores/actor.js'
|
||||
import { useActorStore } from './stores/actor.ts'
|
||||
import { checkBrowser } from './utils/browserCheck.ts'
|
||||
import { signalingKill } from './utils/webrtc/index.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ import LocalVideo from '../shared/LocalVideo.vue'
|
|||
import VideoBottomBar from '../shared/VideoBottomBar.vue'
|
||||
import VideoVue from '../shared/VideoVue.vue'
|
||||
import { ATTENDEE, PARTICIPANT } from '../../../constants.ts'
|
||||
import { useActorStore } from '../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../stores/actor.ts'
|
||||
import { useCallViewStore } from '../../../stores/callView.ts'
|
||||
import { placeholderImage, placeholderModel, placeholderName, placeholderSharedData } from './gridPlaceholders.ts'
|
||||
|
||||
|
|
@ -504,7 +504,7 @@ export default {
|
|||
},
|
||||
|
||||
isGuestNonModerator() {
|
||||
return this.actorStore.actorType === ATTENDEE.ACTOR_TYPE.GUESTS
|
||||
return this.actorStore.isActorGuest
|
||||
&& this.$store.getters.conversation(this.token).participantType !== PARTICIPANT.TYPE.GUEST_MODERATOR
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ import AccountOff from 'vue-material-design-icons/AccountOff.vue'
|
|||
import AvatarWrapper from '../../AvatarWrapper/AvatarWrapper.vue'
|
||||
import VideoBackground from './VideoBackground.vue'
|
||||
import { AVATAR } from '../../../constants.ts'
|
||||
import { useActorStore } from '../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../stores/actor.ts'
|
||||
import { useCallViewStore } from '../../../stores/callView.ts'
|
||||
import attachMediaStream from '../../../utils/attachmediastream.js'
|
||||
import { ConnectionState } from '../../../utils/webrtc/models/CallParticipantModel.js'
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import usernameToColor from '@nextcloud/vue/functions/usernameToColor'
|
|||
import Hex from 'crypto-js/enc-hex.js'
|
||||
import SHA1 from 'crypto-js/sha1.js'
|
||||
import TransitionWrapper from '../../UIShared/TransitionWrapper.vue'
|
||||
import { useActorStore } from '../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../stores/actor.ts'
|
||||
import { useGuestNameStore } from '../../../stores/guestName.js'
|
||||
|
||||
const reactions = {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import VideoOff from 'vue-material-design-icons/VideoOff.vue'
|
|||
import VideoBottomBar from './VideoBottomBar.vue'
|
||||
import { CONVERSATION, PARTICIPANT } from '../../../constants.ts'
|
||||
import storeConfig from '../../../store/storeConfig.js'
|
||||
import { useActorStore } from '../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../stores/actor.ts'
|
||||
import { useCallViewStore } from '../../../stores/callView.ts'
|
||||
import { findNcButton } from '../../../test-helpers.js'
|
||||
import { ConnectionState } from '../../../utils/webrtc/models/CallParticipantModel.js'
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ import VideoIcon from 'vue-material-design-icons/Video.vue'
|
|||
import VideoOff from 'vue-material-design-icons/VideoOff.vue'
|
||||
import TransitionWrapper from '../../UIShared/TransitionWrapper.vue'
|
||||
import { PARTICIPANT } from '../../../constants.ts'
|
||||
import { useActorStore } from '../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../stores/actor.ts'
|
||||
import { useCallViewStore } from '../../../stores/callView.ts'
|
||||
import { ConnectionState } from '../../../utils/webrtc/models/CallParticipantModel.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ import TransitionWrapper from './UIShared/TransitionWrapper.vue'
|
|||
import { CONVERSATION, PARTICIPANT } from '../constants.ts'
|
||||
import { getTalkConfig } from '../services/CapabilitiesManager.ts'
|
||||
import { EventBus } from '../services/EventBus.ts'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import { useChatExtrasStore } from '../stores/chatExtras.js'
|
||||
|
||||
export default {
|
||||
|
|
@ -126,7 +126,7 @@ export default {
|
|||
},
|
||||
|
||||
isGuestWithoutDisplayName() {
|
||||
return !this.actorStore.displayName && this.isGuest
|
||||
return this.isGuest && !this.actorStore.displayName
|
||||
},
|
||||
|
||||
canUploadFiles() {
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ import RecordingConsentSettings from './RecordingConsentSettings.vue'
|
|||
import SipSettings from './SipSettings.vue'
|
||||
import { CALL, CONFIG, CONVERSATION, PARTICIPANT } from '../../constants.ts'
|
||||
import { getTalkConfig, hasTalkFeature } from '../../services/CapabilitiesManager.ts'
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import { useSettingsStore } from '../../stores/settings.js'
|
||||
|
||||
const supportsArchive = hasTalkFeature('local', 'archived-conversations-v2')
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import { useStore } from '../../composables/useStore.js'
|
|||
import { CONVERSATION } from '../../constants.ts'
|
||||
import { getTalkConfig, hasTalkFeature } from '../../services/CapabilitiesManager.ts'
|
||||
import { EventBus } from '../../services/EventBus.ts'
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import { useDashboardStore } from '../../stores/dashboard.ts'
|
||||
import { hasUnreadMentions } from '../../utils/conversation.ts'
|
||||
import { copyConversationLinkToClipboard } from '../../utils/handleUrl.ts'
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ import { callSIPDialOut } from '../../../services/callsService.js'
|
|||
import { hasTalkFeature } from '../../../services/CapabilitiesManager.ts'
|
||||
import { createLegacyConversation } from '../../../services/conversationsService.ts'
|
||||
import { addParticipant } from '../../../services/participantsService.js'
|
||||
import { useActorStore } from '../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../stores/actor.ts'
|
||||
|
||||
export default {
|
||||
name: 'CallPhoneDialog',
|
||||
|
|
@ -163,7 +163,7 @@ export default {
|
|||
console.info('Joining call')
|
||||
await this.$store.dispatch('joinCall', {
|
||||
token,
|
||||
participantIdentifier: this.actorStore.getParticipantIdentifier,
|
||||
participantIdentifier: this.actorStore.participantIdentifier,
|
||||
flags,
|
||||
silent: false,
|
||||
recordingConsent: true,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import { searchListedConversations } from '../../services/conversationsService.t
|
|||
import { autocompleteQuery } from '../../services/coreService.ts'
|
||||
import { EventBus } from '../../services/EventBus.ts'
|
||||
import storeConfig from '../../store/storeConfig.js'
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import { findNcActionButton, findNcButton } from '../../test-helpers.js'
|
||||
import { requestTabLeadership } from '../../utils/requestTabLeadership.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ import {
|
|||
import { autocompleteQuery } from '../../services/coreService.ts'
|
||||
import { EventBus } from '../../services/EventBus.ts'
|
||||
import { talkBroadcastChannel } from '../../services/talkBroadcastChannel.js'
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import { useFederationStore } from '../../stores/federation.ts'
|
||||
import { useSettingsStore } from '../../stores/settings.js'
|
||||
import { useTalkHashStore } from '../../stores/talkHash.js'
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ import NcRichText from '@nextcloud/vue/components/NcRichText'
|
|||
import RoomService from 'vue-material-design-icons/RoomService.vue'
|
||||
import GuestWelcomeWindow from './GuestWelcomeWindow.vue'
|
||||
import SetGuestUsername from './SetGuestUsername.vue'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import { futureRelativeTime, ONE_DAY_IN_MS } from '../utils/formattedTime.ts'
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ import { useIsInCall } from '../../composables/useIsInCall.js'
|
|||
import { AVATAR, CALL, CONFIG, PARTICIPANT, VIRTUAL_BACKGROUND } from '../../constants.ts'
|
||||
import BrowserStorage from '../../services/BrowserStorage.js'
|
||||
import { getTalkConfig } from '../../services/CapabilitiesManager.ts'
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import { useGuestNameStore } from '../../stores/guestName.js'
|
||||
import { useSettingsStore } from '../../stores/settings.js'
|
||||
import { localMediaModel } from '../../utils/webrtc/index.js'
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ import { VIRTUAL_BACKGROUND } from '../../constants.ts'
|
|||
import BrowserStorage from '../../services/BrowserStorage.js'
|
||||
import { getTalkConfig } from '../../services/CapabilitiesManager.ts'
|
||||
import { getDavClient } from '../../services/DavClient.js'
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import { useSettingsStore } from '../../stores/settings.js'
|
||||
import { findUniquePath } from '../../utils/fileUpload.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import * as useIsInCallModule from '../../../../composables/useIsInCall.js'
|
|||
import { ATTENDEE, CONVERSATION, MESSAGE, PARTICIPANT } from '../../../../constants.ts'
|
||||
import { EventBus } from '../../../../services/EventBus.ts'
|
||||
import storeConfig from '../../../../store/storeConfig.js'
|
||||
import { useActorStore } from '../../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../../stores/actor.ts'
|
||||
|
||||
// needed because of https://github.com/vuejs/vue-test-utils/issues/1507
|
||||
const RichTextStub = {
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ import Reactions from './MessagePart/Reactions.vue'
|
|||
import { CONVERSATION, MENTION, MESSAGE, PARTICIPANT } from '../../../../constants.ts'
|
||||
import { getTalkConfig, hasTalkFeature } from '../../../../services/CapabilitiesManager.ts'
|
||||
import { EventBus } from '../../../../services/EventBus.ts'
|
||||
import { useActorStore } from '../../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../../stores/actor.ts'
|
||||
import { useChatExtrasStore } from '../../../../stores/chatExtras.js'
|
||||
import { getItemTypeFromMessage } from '../../../../utils/getItemTypeFromMessage.ts'
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import MessageButtonsBar from './../MessageButtonsBar/MessageButtonsBar.vue'
|
|||
import * as useMessageInfoModule from '../../../../../composables/useMessageInfo.js'
|
||||
import { ATTENDEE, CONVERSATION, MESSAGE, PARTICIPANT } from '../../../../../constants.ts'
|
||||
import storeConfig from '../../../../../store/storeConfig.js'
|
||||
import { useActorStore } from '../../../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../../../stores/actor.ts'
|
||||
import { useIntegrationsStore } from '../../../../../stores/integrations.js'
|
||||
import { findNcActionButton, findNcButton } from '../../../../../test-helpers.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ import { useMessageInfo } from '../../../../../composables/useMessageInfo.js'
|
|||
import { ATTENDEE, CONVERSATION, MESSAGE, PARTICIPANT } from '../../../../../constants.ts'
|
||||
import { hasTalkFeature } from '../../../../../services/CapabilitiesManager.ts'
|
||||
import { getMessageReminder, removeMessageReminder, setMessageReminder } from '../../../../../services/remindersService.js'
|
||||
import { useActorStore } from '../../../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../../../stores/actor.ts'
|
||||
import { useIntegrationsStore } from '../../../../../stores/integrations.js'
|
||||
import { useReactionsStore } from '../../../../../stores/reactions.js'
|
||||
import { generatePublicShareDownloadUrl, generateUserFileUrl } from '../../../../../utils/davUtils.ts'
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import { t } from '@nextcloud/l10n'
|
|||
import { encodePath } from '@nextcloud/paths'
|
||||
import { generateRemoteUrl } from '@nextcloud/router'
|
||||
import { EventBus } from '../../../../../services/EventBus.ts'
|
||||
import { useActorStore } from '../../../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../../../stores/actor.ts'
|
||||
|
||||
export default {
|
||||
name: 'AudioPlayer',
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import NcButton from '@nextcloud/vue/components/NcButton'
|
|||
import PlayCircleOutline from 'vue-material-design-icons/PlayCircleOutline.vue'
|
||||
import FilePreview from './FilePreview.vue'
|
||||
import storeConfig from '../../../../../store/storeConfig.js'
|
||||
import { useActorStore } from '../../../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../../../stores/actor.ts'
|
||||
|
||||
describe('FilePreview.vue', () => {
|
||||
let store
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ import AudioPlayer from './AudioPlayer.vue'
|
|||
import { useViewer } from '../../../../../composables/useViewer.js'
|
||||
import { SHARED_ITEM } from '../../../../../constants.ts'
|
||||
import { getTalkConfig } from '../../../../../services/CapabilitiesManager.ts'
|
||||
import { useActorStore } from '../../../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../../../stores/actor.ts'
|
||||
import { useSharedItemsStore } from '../../../../../stores/sharedItems.js'
|
||||
|
||||
const PREVIEW_TYPE = {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import { useIsDarkTheme } from '@nextcloud/vue/composables/useIsDarkTheme'
|
|||
import NcUserBubble from '@nextcloud/vue/components/NcUserBubble'
|
||||
import { MENTION } from '../../../../../constants.ts'
|
||||
import { getConversationAvatarOcsUrl, getUserProxyAvatarOcsUrl } from '../../../../../services/avatarService.ts'
|
||||
import { useActorStore } from '../../../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../../../stores/actor.ts'
|
||||
|
||||
export default {
|
||||
name: 'Mention',
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import {
|
|||
} from '../../../../../services/reactionsService.ts'
|
||||
import vuexStore from '../../../../../store/index.js'
|
||||
import storeConfig from '../../../../../store/storeConfig.js'
|
||||
import { useActorStore } from '../../../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../../../stores/actor.ts'
|
||||
import { useReactionsStore } from '../../../../../stores/reactions.js'
|
||||
import { generateOCSResponse } from '../../../../../test-helpers.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ import EmoticonPlusOutline from 'vue-material-design-icons/EmoticonPlusOutline.v
|
|||
import HeartOutlineIcon from 'vue-material-design-icons/HeartOutline.vue'
|
||||
import ReactionsList from './ReactionsList.vue'
|
||||
import { ATTENDEE } from '../../../../../constants.ts'
|
||||
import { useActorStore } from '../../../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../../../stores/actor.ts'
|
||||
import { useGuestNameStore } from '../../../../../stores/guestName.js'
|
||||
import { useReactionsStore } from '../../../../../stores/reactions.js'
|
||||
import { getDisplayNameWithFallback } from '../../../../../utils/getDisplayName.ts'
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import Vuex from 'vuex'
|
|||
import MessagesGroup from './MessagesGroup.vue'
|
||||
import { ATTENDEE, MESSAGE } from '../../../constants.ts'
|
||||
import storeConfig from '../../../store/storeConfig.js'
|
||||
import { useActorStore } from '../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../stores/actor.ts'
|
||||
import { useGuestNameStore } from '../../../stores/guestName.js'
|
||||
|
||||
describe('MessagesGroup.vue', () => {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import AvatarWrapper from '../../AvatarWrapper/AvatarWrapper.vue'
|
|||
import Message from './Message/Message.vue'
|
||||
import { useMessageInfo } from '../../../composables/useMessageInfo.js'
|
||||
import { ATTENDEE, AVATAR } from '../../../constants.ts'
|
||||
import { useActorStore } from '../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../stores/actor.ts'
|
||||
import { useGuestNameStore } from '../../../stores/guestName.js'
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ import BrowserStorage from '../../services/BrowserStorage.js'
|
|||
import { getTalkConfig, hasTalkFeature } from '../../services/CapabilitiesManager.ts'
|
||||
import { EventBus } from '../../services/EventBus.ts'
|
||||
import { shareFile } from '../../services/filesSharingServices.ts'
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import { useChatExtrasStore } from '../../stores/chatExtras.js'
|
||||
import { useGroupwareStore } from '../../stores/groupware.ts'
|
||||
import { useSettingsStore } from '../../stores/settings.js'
|
||||
|
|
@ -891,8 +891,8 @@ export default {
|
|||
|
||||
// last message within 24 hours
|
||||
const lastMessageByCurrentUser = this.$store.getters.messagesList(this.token).findLast((message) => {
|
||||
return message.actorId === this.actorStore.userId
|
||||
&& message.actorType === this.actorStore.userType
|
||||
return message.actorId === this.actorStore.actorId
|
||||
&& message.actorType === this.actorStore.actorType
|
||||
&& !message.isTemporary && !message.systemMessage
|
||||
&& (Date.now() - message.timestamp * 1000 < ONE_DAY_IN_MS)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import { n, t } from '@nextcloud/l10n'
|
|||
import escapeHtml from 'escape-html'
|
||||
import AvatarWrapper from '../AvatarWrapper/AvatarWrapper.vue'
|
||||
import { AVATAR } from '../../constants.ts'
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import { useGuestNameStore } from '../../stores/guestName.js'
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ import { useIsInCall } from '../../composables/useIsInCall.js'
|
|||
import { POLL } from '../../constants.ts'
|
||||
import { hasTalkFeature } from '../../services/CapabilitiesManager.ts'
|
||||
import { EventBus } from '../../services/EventBus.ts'
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import { usePollsStore } from '../../stores/polls.ts'
|
||||
import { calculateVotePercentage } from '../../utils/calculateVotePercentage.ts'
|
||||
import { convertToJSONDataURI } from '../../utils/fileDownload.ts'
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ import FilePreview from './MessagesList/MessagesGroup/Message/MessagePart/FilePr
|
|||
import { useMessageInfo } from '../composables/useMessageInfo.js'
|
||||
import { ATTENDEE, AVATAR } from '../constants.ts'
|
||||
import { EventBus } from '../services/EventBus.ts'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import { useChatExtrasStore } from '../stores/chatExtras.js'
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import AvatarWrapper from '../../AvatarWrapper/AvatarWrapper.vue'
|
|||
import Participant from './Participant.vue'
|
||||
import { ATTENDEE, PARTICIPANT, WEBINAR } from '../../../constants.ts'
|
||||
import storeConfig from '../../../store/storeConfig.js'
|
||||
import { useActorStore } from '../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../stores/actor.ts'
|
||||
import { findNcActionButton, findNcButton } from '../../../test-helpers.js'
|
||||
|
||||
describe('Participant.vue', () => {
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ import {
|
|||
callSIPUnmutePhone,
|
||||
} from '../../../services/callsService.js'
|
||||
import { hasTalkFeature } from '../../../services/CapabilitiesManager.ts'
|
||||
import { useActorStore } from '../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../stores/actor.ts'
|
||||
import { formattedTime } from '../../../utils/formattedTime.ts'
|
||||
import { getDisplayNameWithFallback } from '../../../utils/getDisplayName.ts'
|
||||
import { readableNumber } from '../../../utils/readableNumber.ts'
|
||||
|
|
@ -906,7 +906,7 @@ export default {
|
|||
console.info('Joining call')
|
||||
await this.$store.dispatch('joinCall', {
|
||||
token: this.token,
|
||||
participantIdentifier: this.actorStore.getParticipantIdentifier,
|
||||
participantIdentifier: this.actorStore.participantIdentifier,
|
||||
flags,
|
||||
silent: false,
|
||||
recordingConsent: true,
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ import { getTalkConfig, hasTalkFeature } from '../../../services/CapabilitiesMan
|
|||
import { autocompleteQuery } from '../../../services/coreService.ts'
|
||||
import { EventBus } from '../../../services/EventBus.ts'
|
||||
import { addParticipant } from '../../../services/participantsService.js'
|
||||
import { useActorStore } from '../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../stores/actor.ts'
|
||||
import { useSidebarStore } from '../../../stores/sidebar.ts'
|
||||
import CancelableRequest from '../../../utils/cancelableRequest.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ import SharedItemsTab from './SharedItems/SharedItemsTab.vue'
|
|||
import SipSettings from './SipSettings.vue'
|
||||
import { CONVERSATION, PARTICIPANT, WEBINAR } from '../../constants.ts'
|
||||
import { getTalkConfig, hasTalkFeature } from '../../services/CapabilitiesManager.ts'
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import { useSidebarStore } from '../../stores/sidebar.ts'
|
||||
|
||||
const canStartConversations = getTalkConfig('local', 'conversations', 'can-create')
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ import SharedItemsBrowser from './SharedItemsBrowser.vue'
|
|||
import { CONVERSATION } from '../../../constants.ts'
|
||||
import { hasTalkFeature } from '../../../services/CapabilitiesManager.ts'
|
||||
import { EventBus } from '../../../services/EventBus.ts'
|
||||
import { useActorStore } from '../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../stores/actor.ts'
|
||||
import { useSharedItemsStore } from '../../../stores/sharedItems.js'
|
||||
import { useSidebarStore } from '../../../stores/sidebar.ts'
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ import escapeHtml from 'escape-html'
|
|||
import NcButton from '@nextcloud/vue/components/NcButton'
|
||||
import NcTextField from '@nextcloud/vue/components/NcTextField'
|
||||
import Pencil from 'vue-material-design-icons/Pencil.vue'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import { useGuestNameStore } from '../stores/guestName.js'
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ import BrowserStorage from '../../services/BrowserStorage.js'
|
|||
import { getTalkConfig } from '../../services/CapabilitiesManager.ts'
|
||||
import { useCustomSettings } from '../../services/SettingsAPI.ts'
|
||||
import { setUserConfig } from '../../services/settingsService.ts'
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import { useSettingsStore } from '../../stores/settings.js'
|
||||
import { useSoundsStore } from '../../stores/sounds.js'
|
||||
import { isMac } from '../../utils/browserCheck.ts'
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ import { ATTENDEE, CALL, CONVERSATION, PARTICIPANT } from '../../constants.ts'
|
|||
import { callSIPDialOut } from '../../services/callsService.js'
|
||||
import { hasTalkFeature } from '../../services/CapabilitiesManager.ts'
|
||||
import { EventBus } from '../../services/EventBus.ts'
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import { useBreakoutRoomsStore } from '../../stores/breakoutRooms.ts'
|
||||
import { useCallViewStore } from '../../stores/callView.ts'
|
||||
import { useSettingsStore } from '../../stores/settings.js'
|
||||
|
|
@ -397,7 +397,7 @@ export default {
|
|||
})
|
||||
await this.$store.dispatch('joinCall', {
|
||||
token: this.token,
|
||||
participantIdentifier: this.actorStore.getParticipantIdentifier,
|
||||
participantIdentifier: this.actorStore.participantIdentifier,
|
||||
flags,
|
||||
silent: this.hasCall ? true : this.silentCall,
|
||||
recordingConsent: this.recordingConsentGiven,
|
||||
|
|
@ -438,7 +438,7 @@ export default {
|
|||
})
|
||||
await this.$store.dispatch('leaveCall', {
|
||||
token: this.token,
|
||||
participantIdentifier: this.actorStore.getParticipantIdentifier,
|
||||
participantIdentifier: this.actorStore.participantIdentifier,
|
||||
all: endMeetingForAll,
|
||||
})
|
||||
this.loading = false
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ import TopBarMenu from './TopBarMenu.vue'
|
|||
import { useGetParticipants } from '../../composables/useGetParticipants.js'
|
||||
import { AVATAR, CONVERSATION } from '../../constants.ts'
|
||||
import { getTalkConfig, hasTalkFeature } from '../../services/CapabilitiesManager.ts'
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import { useGroupwareStore } from '../../stores/groupware.ts'
|
||||
import { useSidebarStore } from '../../stores/sidebar.ts'
|
||||
import { getStatusMessage } from '../../utils/userStatus.ts'
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ import {
|
|||
import { useIsInCall } from '../../composables/useIsInCall.js'
|
||||
import { CALL, CONVERSATION, PARTICIPANT } from '../../constants.ts'
|
||||
import { getTalkConfig, hasTalkFeature } from '../../services/CapabilitiesManager.ts'
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import { useBreakoutRoomsStore } from '../../stores/breakoutRooms.ts'
|
||||
import { useCallViewStore } from '../../stores/callView.ts'
|
||||
import { generateAbsoluteUrl } from '../../utils/handleUrl.ts'
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import { n, t } from '@nextcloud/l10n'
|
||||
import cloneDeep from 'lodash/cloneDeep.js'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import { useStore } from './useStore.js'
|
||||
|
||||
/**
|
||||
|
|
@ -14,17 +14,7 @@ import { useStore } from './useStore.js'
|
|||
*/
|
||||
export function useCombinedSystemMessage() {
|
||||
const store = useStore()
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {object} message message to check for
|
||||
* @return {boolean}
|
||||
*/
|
||||
function checkIfSelfIsActor(message) {
|
||||
const actorStore = useActorStore()
|
||||
return message.actorId === actorStore.actorId
|
||||
&& message.actorType === actorStore.actorType
|
||||
}
|
||||
const actorStore = useActorStore()
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -32,7 +22,6 @@ export function useCombinedSystemMessage() {
|
|||
* @return {boolean}
|
||||
*/
|
||||
function checkIfSelfIsOneOfActors(message) {
|
||||
const actorStore = useActorStore()
|
||||
return message.messageParameters.actor.id === actorStore.actorId
|
||||
&& message.messageParameters.actor.type + 's' === actorStore.actorType
|
||||
}
|
||||
|
|
@ -43,7 +32,6 @@ export function useCombinedSystemMessage() {
|
|||
* @return {boolean}
|
||||
*/
|
||||
function checkIfSelfIsOneOfUsers(message) {
|
||||
const actorStore = useActorStore()
|
||||
return message.messageParameters.user.id === actorStore.actorId
|
||||
&& message.messageParameters.user.type + 's' === actorStore.actorType
|
||||
}
|
||||
|
|
@ -94,7 +82,7 @@ export function useCombinedSystemMessage() {
|
|||
usersCounter++
|
||||
})
|
||||
|
||||
if (checkIfSelfIsActor(combinedMessage)) {
|
||||
if (actorStore.checkIfSelfIsActor(combinedMessage)) {
|
||||
if (usersCounter === 2) {
|
||||
combinedMessage.message = t('spreed', 'You added {user0} and {user1}')
|
||||
} else {
|
||||
|
|
@ -160,7 +148,7 @@ export function useCombinedSystemMessage() {
|
|||
usersCounter++
|
||||
})
|
||||
|
||||
if (checkIfSelfIsActor(combinedMessage)) {
|
||||
if (actorStore.checkIfSelfIsActor(combinedMessage)) {
|
||||
if (usersCounter === 2) {
|
||||
combinedMessage.message = t('spreed', 'You removed {user0} and {user1}')
|
||||
} else {
|
||||
|
|
@ -303,7 +291,7 @@ export function useCombinedSystemMessage() {
|
|||
usersCounter++
|
||||
})
|
||||
|
||||
if (checkIfSelfIsActor(combinedMessage)) {
|
||||
if (actorStore.checkIfSelfIsActor(combinedMessage)) {
|
||||
if (usersCounter === 2) {
|
||||
combinedMessage.message = t('spreed', 'You promoted {user0} and {user1} to moderators')
|
||||
} else {
|
||||
|
|
@ -369,7 +357,7 @@ export function useCombinedSystemMessage() {
|
|||
usersCounter++
|
||||
})
|
||||
|
||||
if (checkIfSelfIsActor(combinedMessage)) {
|
||||
if (actorStore.checkIfSelfIsActor(combinedMessage)) {
|
||||
if (usersCounter === 2) {
|
||||
combinedMessage.message = t('spreed', 'You demoted {user0} and {user1} from moderators')
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { t } from '@nextcloud/l10n'
|
|||
import { computed, ref, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router/composables'
|
||||
import { EventBus } from '../services/EventBus.ts'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import { hasCall, hasUnreadMentions } from '../utils/conversation.ts'
|
||||
import { useDocumentVisibility } from './useDocumentVisibility.ts'
|
||||
import { useStore } from './useStore.js'
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { t } from '@nextcloud/l10n'
|
|||
import { computed, ref } from 'vue'
|
||||
import { ATTENDEE, CONVERSATION, MESSAGE } from '../constants.ts'
|
||||
import { hasTalkFeature } from '../services/CapabilitiesManager.ts'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import { useGuestNameStore } from '../stores/guestName.js'
|
||||
import { ONE_DAY_IN_MS, ONE_HOUR_IN_MS } from '../utils/formattedTime.ts'
|
||||
import { getDisplayNameWithFallback } from '../utils/getDisplayName.ts'
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import type { PrepareTemporaryMessagePayload } from '../utils/prepareTemporaryMessage.ts'
|
||||
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import { useChatExtrasStore } from '../stores/chatExtras.js'
|
||||
import { prepareTemporaryMessage } from '../utils/prepareTemporaryMessage.ts'
|
||||
import { useStore } from './useStore.js'
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ import {
|
|||
stopCallRecording,
|
||||
} from '../services/recordingService.js'
|
||||
import { talkBroadcastChannel } from '../services/talkBroadcastChannel.js'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import { useBreakoutRoomsStore } from '../stores/breakoutRooms.ts'
|
||||
import { useChatExtrasStore } from '../stores/chatExtras.js'
|
||||
import { useFederationStore } from '../stores/federation.ts'
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import {
|
|||
shareFile,
|
||||
} from '../services/filesSharingServices.ts'
|
||||
import { setAttachmentFolder } from '../services/settingsService.ts'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import { useChatExtrasStore } from '../stores/chatExtras.js'
|
||||
import {
|
||||
findUniquePath,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import Vuex from 'vuex'
|
|||
import { getDavClient } from '../services/DavClient.js'
|
||||
import { shareFile } from '../services/filesSharingServices.ts'
|
||||
import { setAttachmentFolder } from '../services/settingsService.ts'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import { findUniquePath } from '../utils/fileUpload.js'
|
||||
import fileUploadStore from './fileUploadStore.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import {
|
|||
postRichObjectToConversation,
|
||||
updateLastReadMessage,
|
||||
} from '../services/messagesService.ts'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import { useCallViewStore } from '../stores/callView.ts'
|
||||
import { useGuestNameStore } from '../stores/guestName.js'
|
||||
import { usePollsStore } from '../stores/polls.ts'
|
||||
|
|
@ -1189,7 +1189,7 @@ const actions = {
|
|||
|
||||
context.dispatch('leaveCall', {
|
||||
token,
|
||||
participantIdentifier: actorStore.getParticipantIdentifier,
|
||||
participantIdentifier: actorStore.participantIdentifier,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import {
|
|||
postRichObjectToConversation,
|
||||
updateLastReadMessage,
|
||||
} from '../services/messagesService.ts'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import { useGuestNameStore } from '../stores/guestName.js'
|
||||
import { useReactionsStore } from '../stores/reactions.js'
|
||||
import { generateOCSErrorResponse, generateOCSResponse } from '../test-helpers.js'
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import {
|
|||
} from '../services/participantsService.js'
|
||||
import SessionStorage from '../services/SessionStorage.js'
|
||||
import { talkBroadcastChannel } from '../services/talkBroadcastChannel.js'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import { useCallViewStore } from '../stores/callView.ts'
|
||||
import { useGuestNameStore } from '../stores/guestName.js'
|
||||
import { useSessionStore } from '../stores/session.ts'
|
||||
|
|
@ -1037,7 +1037,7 @@ const actions = {
|
|||
context.dispatch('addConversation', response.data.ocs.data)
|
||||
context.dispatch('updateSessionId', {
|
||||
token,
|
||||
participantIdentifier: actorStore.getParticipantIdentifier,
|
||||
participantIdentifier: actorStore.participantIdentifier,
|
||||
sessionId: response.data.ocs.data.sessionId,
|
||||
})
|
||||
|
||||
|
|
@ -1089,7 +1089,7 @@ const actions = {
|
|||
if (context.getters.isInCall(token)) {
|
||||
await context.dispatch('leaveCall', {
|
||||
token,
|
||||
participantIdentifier: actorStore.getParticipantIdentifier,
|
||||
participantIdentifier: actorStore.participantIdentifier,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import {
|
|||
removeCurrentUserFromConversation,
|
||||
resendInvitations,
|
||||
} from '../services/participantsService.js'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import { useGuestNameStore } from '../stores/guestName.js'
|
||||
import { useSessionStore } from '../stores/session.ts'
|
||||
import { generateOCSErrorResponse, generateOCSResponse } from '../test-helpers.js'
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
import { createPinia, setActivePinia } from 'pinia'
|
||||
import { PARTICIPANT } from '../../constants.ts'
|
||||
import { useActorStore } from '../actor.js'
|
||||
import { useActorStore } from '../actor.ts'
|
||||
|
||||
describe('actorStore', () => {
|
||||
let actorStore
|
||||
|
|
|
|||
|
|
@ -10,17 +10,15 @@
|
|||
* If an as no userId, they are a guest and identified by actorType + sessionId.
|
||||
*/
|
||||
|
||||
import { loadState } from '@nextcloud/initial-state'
|
||||
import { defineStore } from 'pinia'
|
||||
import { ATTENDEE, PARTICIPANT } from '../constants.ts'
|
||||
import { getTeams } from '../services/teamsService.ts'
|
||||
import { ref, computed } from 'vue'
|
||||
import type { NextcloudUser } from '@nextcloud/auth'
|
||||
import type { Participant } from '../types/index.ts'
|
||||
|
||||
interface NextcloudUser {
|
||||
uid: string
|
||||
displayName: string | null
|
||||
}
|
||||
import { getCurrentUser } from '@nextcloud/auth'
|
||||
import { loadState } from '@nextcloud/initial-state'
|
||||
import { defineStore } from 'pinia'
|
||||
import { computed, ref } from 'vue'
|
||||
import { ATTENDEE, PARTICIPANT } from '../constants.ts'
|
||||
import { getTeams } from '../services/teamsService.ts'
|
||||
|
||||
export const useActorStore = defineStore('actor', () => {
|
||||
const userId = ref<string | null>(null)
|
||||
|
|
@ -32,15 +30,32 @@ export const useActorStore = defineStore('actor', () => {
|
|||
const actorGroups = ref<string[]>(loadState('spreed', 'user_group_ids', []))
|
||||
const actorTeams = ref<string[]>([])
|
||||
|
||||
const isLoggedIn = computed(() => userId.value !== null)
|
||||
const isActorUser = computed(() => actorType.value === ATTENDEE.ACTOR_TYPE.USERS)
|
||||
const isActorGuest = computed(() => actorType.value === ATTENDEE.ACTOR_TYPE.GUESTS)
|
||||
const getParticipantIdentifier = computed(() => ({
|
||||
const participantIdentifier = computed(() => ({
|
||||
attendeeId: attendeeId.value,
|
||||
actorType: actorType.value,
|
||||
actorId: actorId.value,
|
||||
sessionId: sessionId.value,
|
||||
}))
|
||||
|
||||
// Initialize the store
|
||||
initialize()
|
||||
|
||||
/**
|
||||
* Initialize the actor store.
|
||||
*/
|
||||
function initialize() {
|
||||
if (getCurrentUser()) {
|
||||
console.debug('Setting current user')
|
||||
setCurrentUser(getCurrentUser())
|
||||
getCurrentUserTeams()
|
||||
} else {
|
||||
console.debug('Can not set current user because it\'s a guest')
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the actor is a member of a group
|
||||
*
|
||||
|
|
@ -59,6 +74,16 @@ export const useActorStore = defineStore('actor', () => {
|
|||
return actorTeams.value.includes(teamId)
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the message is from the current actor
|
||||
*
|
||||
* @param payload object to check for
|
||||
*/
|
||||
function checkIfSelfIsActor(payload: { actorId?: string, actorType?: string }) {
|
||||
return payload.actorId === actorId.value
|
||||
&& payload.actorType === actorType.value
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the display name of the actor
|
||||
*
|
||||
|
|
@ -75,7 +100,10 @@ export const useActorStore = defineStore('actor', () => {
|
|||
* @param user.uid The user id of the user
|
||||
* @param user.displayName The display name of the user
|
||||
*/
|
||||
function setCurrentUser(user: NextcloudUser) {
|
||||
function setCurrentUser(user: NextcloudUser | null) {
|
||||
if (!user) {
|
||||
return
|
||||
}
|
||||
userId.value = user.uid
|
||||
displayName.value = user.displayName || user.uid
|
||||
actorType.value = ATTENDEE.ACTOR_TYPE.USERS
|
||||
|
|
@ -94,7 +122,7 @@ export const useActorStore = defineStore('actor', () => {
|
|||
function setCurrentParticipant(participant: Participant & { sessionId: string }) {
|
||||
sessionId.value = participant.sessionId
|
||||
attendeeId.value = participant.attendeeId
|
||||
|
||||
// FIXME other actor types like EMAILS
|
||||
if (participant.participantType === PARTICIPANT.TYPE.GUEST
|
||||
|| participant.participantType === PARTICIPANT.TYPE.GUEST_MODERATOR) {
|
||||
// FIXME displayName.value = ''
|
||||
|
|
@ -130,13 +158,16 @@ export const useActorStore = defineStore('actor', () => {
|
|||
displayName,
|
||||
actorGroups,
|
||||
actorTeams,
|
||||
isLoggedIn,
|
||||
isActorUser,
|
||||
isActorGuest,
|
||||
getParticipantIdentifier,
|
||||
|
||||
participantIdentifier,
|
||||
|
||||
isActorMemberOfGroup,
|
||||
isActorMemberOfTeam,
|
||||
checkIfSelfIsActor,
|
||||
|
||||
initialize,
|
||||
setDisplayName,
|
||||
setCurrentUser,
|
||||
setCurrentParticipant,
|
||||
|
|
@ -9,7 +9,7 @@ import { defineStore } from 'pinia'
|
|||
import Vue from 'vue'
|
||||
import { setGuestUserName } from '../services/participantsService.js'
|
||||
import store from '../store/index.js'
|
||||
import { useActorStore } from './actor.js'
|
||||
import { useActorStore } from './actor.ts'
|
||||
|
||||
export const useGuestNameStore = defineStore('guestName', {
|
||||
state: () => ({
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import pinia from '../stores/pinia.ts'
|
||||
import SignalingParticipantList from './SignalingParticipantList.js'
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import { EventBus } from '../services/EventBus.ts'
|
|||
import { rejoinConversation } from '../services/participantsService.js'
|
||||
import { pullSignalingMessages } from '../services/signalingService.js'
|
||||
import store from '../store/index.js'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
import pinia from '../stores/pinia.ts'
|
||||
import CancelableRequest from './cancelableRequest.js'
|
||||
import Encryption from './e2ee/encryption.js'
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* modified only when the current conversation is joined and call is started.
|
||||
*/
|
||||
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import pinia from '../../stores/pinia.ts'
|
||||
export default class SpeakingStatusHandler {
|
||||
// Constants, properties
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import { reactive, watch } from 'vue'
|
||||
import store from '../../../store/index.js'
|
||||
import { useActorStore } from '../../../stores/actor.js'
|
||||
import { useActorStore } from '../../../stores/actor.ts'
|
||||
import pinia from '../../../stores/pinia.ts'
|
||||
import EmitterMixin from '../../EmitterMixin.js'
|
||||
import { ConnectionState } from './CallParticipantModel.js'
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import {
|
|||
import { t } from '@nextcloud/l10n'
|
||||
import { PARTICIPANT } from '../../constants.ts'
|
||||
import store from '../../store/index.js'
|
||||
import { useActorStore } from '../../stores/actor.js'
|
||||
import { useActorStore } from '../../stores/actor.ts'
|
||||
import pinia from '../../stores/pinia.ts'
|
||||
import { Sounds } from '../sounds.js'
|
||||
import SimpleWebRTC from './simplewebrtc/simplewebrtc.js'
|
||||
|
|
@ -476,7 +476,7 @@ function usersInCallChanged(signaling, users) {
|
|||
console.info('Force leaving the call for current participant')
|
||||
store.dispatch('leaveCall', {
|
||||
token: store.getters.getToken(),
|
||||
participantIdentifier: actorStore.getParticipantIdentifier,
|
||||
participantIdentifier: actorStore.participantIdentifier,
|
||||
})
|
||||
|
||||
// Do not return to disconnect already from the other participants
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import PollViewer from '../components/PollViewer/PollViewer.vue'
|
|||
import TopBar from '../components/TopBar/TopBar.vue'
|
||||
import { useIsInCall } from '../composables/useIsInCall.js'
|
||||
import { useStore } from '../composables/useStore.js'
|
||||
import { useActorStore } from '../stores/actor.js'
|
||||
import { useActorStore } from '../stores/actor.ts'
|
||||
|
||||
const props = defineProps<{
|
||||
token: string
|
||||
|
|
@ -34,7 +34,7 @@ watch(isInLobby, (isInLobby) => {
|
|||
if (isInLobby && isInCall.value) {
|
||||
store.dispatch('leaveCall', {
|
||||
token: props.token,
|
||||
participantIdentifier: actorStore.getParticipantIdentifier,
|
||||
participantIdentifier: actorStore.participantIdentifier,
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue