fix(eslint): auto-fix 'jsdoc/require-param' (+ manual adjust)

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
This commit is contained in:
Maksim Sukharev 2025-09-01 15:32:39 +02:00
parent 7586586146
commit 9be0f463c8
40 changed files with 218 additions and 23 deletions

View file

@ -49,7 +49,6 @@ export default [
'jsdoc/check-param-names': 'off', // need to respect JS
'jsdoc/check-tag-names': 'off', // need to respect JS
'jsdoc/check-types': 'off', // need to respect JS
'jsdoc/require-param': 'off', // need to respect JS
'jsdoc/require-param-type': 'off', // need to respect JS
'jsdoc/require-param-description': 'off', // need to respect JS
'no-console': 'off', // non-fixable

View file

@ -163,6 +163,9 @@ export default {
* or close to it already, rather than trying to keep the same visible
* lines the transcript is just scrolled to the bottom; any pending
* scroll to bottom is also cancelled.
*
* @param entries
* @param observer
*/
handleResize(entries: ResizeObserverEntry[], observer: ResizeObserver) {
if (!this.$refs.transcriptBlocks) {

View file

@ -150,6 +150,7 @@ async function startMeeting() {
/**
* Scrolls the event cards wrapper in the specified direction.
*
* @param direction.direction
* @param direction - The direction to scroll ('backward' or 'forward').
*/
function scrollEventCards({ direction }: { direction: 'backward' | 'forward' }) {

View file

@ -36,6 +36,7 @@ import { generateUrl } from '@nextcloud/router'
/**
*
* @param path
*/
function encodeFilePath(path) {
const pathSections = (path.startsWith('/') ? path : `/${path}`).split('/')

View file

@ -104,6 +104,8 @@ const shortenedQuoteMessage = computed(() => {
/**
* Check whether message to quote (parent) existing on server
* Otherwise server returns ['id' => (int)$parentId, 'deleted' => true]
*
* @param message
*/
function isExistingMessage(message: ChatMessage | DeletedParentMessage): message is ChatMessage {
return 'messageType' in message

View file

@ -108,6 +108,9 @@ onBeforeUnmount(() => {
/**
*
* @param payload
* @param payload.from
* @param payload.to
*/
function onRouteChange({ from, to }: { from: RouteLocation, to: RouteLocation }): void {
if (to.name !== 'conversation' || from.params.token !== to.params.token || (to.hash && isInCall.value)) {

View file

@ -82,6 +82,9 @@ watch([token, () => props.active, () => sidebarStore.show], ([token, isActive, i
/**
* Check if there are more items of a specific type than the limit allows.
*
* @param type
* @param items
*/
function hasMore(type: string, items: ShareItemsType) {
return Object.values(items).length > limit(type)
@ -89,6 +92,8 @@ function hasMore(type: string, items: ShareItemsType) {
/**
* Open the SharedItemsBrowser dialog for a specific type of shared items.
*
* @param type
*/
function showMore(type: string) {
browserActiveTab.value = type
@ -97,6 +102,8 @@ function showMore(type: string) {
/**
* Get the limit for the number of items displayed based on the type.
*
* @param type
*/
function limit(type: string) {
return sharedItemsWithPreviewLimit.includes(type) ? 2 : 5

View file

@ -32,6 +32,9 @@ onBeforeUnmount(() => {
/**
*
* @param payload
* @param payload.from
* @param payload.to
*/
function onRouteChange({ from, to }: { from: RouteLocation, to: RouteLocation }): void {
if (to.name !== 'conversation' || from.params.token !== to.params.token || (from.query.threadId !== to.query.threadId && isInCall.value)) {

View file

@ -111,7 +111,11 @@ onBeforeUnmount(() => {
updateDisplayName()
})
/** Update guest username from public page user menu */
/**
* Update guest username from public page user menu
*
* @param payload
*/
function updateDisplayNameFromPublicEvent(payload: NextcloudUser) {
if (payload.displayName && payload.displayName !== guestUserName.value) {
guestUserName.value = payload.displayName

View file

@ -44,6 +44,8 @@ const GET_MESSAGES_CONTEXT_KEY: InjectionKey<GetMessagesContext> = Symbol.for('G
/**
* Check whether caught error is from OCS API
*
* @param exception
*/
function isAxiosErrorResponse(exception: unknown): exception is AxiosError<string> {
return exception !== null && typeof exception === 'object' && 'response' in exception
@ -185,6 +187,8 @@ export function useGetMessagesProvider() {
/**
* Parse hash string to get message id
*
* @param hash
*/
function getMessageIdFromHash(hash?: string): number | null {
return (hash && hash.startsWith('#message_')) ? parseInt(hash.slice(9), 10) : null
@ -212,6 +216,10 @@ export function useGetMessagesProvider() {
/**
* Handle route changes to initialize chat or thread, and focus given message
*
* @param payload
* @param payload.from
* @param payload.to
*/
async function onRouteChange({ from, to }: { from: RouteLocation, to: RouteLocation }) {
// Reset blocker for fetching old messages
@ -241,6 +249,10 @@ export function useGetMessagesProvider() {
/**
* Update contextMessageId to the last message in the conversation
*
* @param token
* @param messageId
* @param threadId
*/
async function checkContextAndFocusMessage(token: string, messageId: number, threadId: number) {
if (!chatStore.hasMessage(token, { messageId, threadId })) {
@ -363,6 +375,8 @@ export function useGetMessagesProvider() {
* @param token token of conversation where a method was called
* @param includeLastKnown Include or exclude the last known message in the response
* @param payload Optional payload to pass additional parameters (messageId, threadId)
* @param payload.messageId
* @param payload.threadId
*/
async function getOldMessages(token: string, includeLastKnown: boolean, payload?: { messageId?: number, threadId?: number }) {
if (isChatBeginningReached.value) {
@ -404,6 +418,8 @@ export function useGetMessagesProvider() {
* @param token token of conversation where a method was called
* @param includeLastKnown Include or exclude the last known message in the response
* @param payload Optional payload to pass additional parameters (messageId, threadId)
* @param payload.messageId
* @param payload.threadId
*/
async function getNewMessages(token: string, includeLastKnown: boolean, payload?: { messageId?: number, threadId?: number }) {
if (isChatEndReached.value) {

View file

@ -75,6 +75,9 @@ function useGetParticipantsComposable(activeTab = ref('participants')) {
/**
* Patch participants list from signaling messages (joined/changed)
*
* @param payload
* @param payload."0" - users list
*/
function handleUsersUpdated([users]: [SignalingSessionPayload[]]) {
if (sessionStore.updateSessions(token.value, users)) {
@ -86,6 +89,9 @@ function useGetParticipantsComposable(activeTab = ref('participants')) {
/**
* Check if current user permission has been changed from signaling messages
*
* @param payload
* @param payload."0" - users list
*/
async function checkCurrentUserPermissions([users]: [StandaloneSignalingUpdateSession[]]) {
// TODO: move logic to sessionStore once experimental flag is dropped
@ -108,6 +114,9 @@ function useGetParticipantsComposable(activeTab = ref('participants')) {
/**
* Patch participants list from signaling messages (left)
*
* @param payload
* @param payload."0" - users list
*/
function handleUsersLeft([sessionIds]: [StandaloneSignalingLeaveSession[]]) {
sessionStore.updateSessionsLeft(token.value, sessionIds)

View file

@ -19,6 +19,8 @@ import { useConversationInfo } from './useConversationInfo.ts'
/**
* Check whether ref's value is not undefined
*
* @param item
*/
function isDefinedRef<T>(item: Ref<T | undefined>): item is Ref<T> {
return item.value !== undefined

View file

@ -63,6 +63,8 @@ function Sidebar() {
/**
*
* @param sidebarElement
* @param resolve
*/
function waitForSidebarToBeOpen(sidebarElement, resolve) {
if ('ontransitionend' in sidebarElement) {

View file

@ -11,6 +11,7 @@ import './init.js'
/**
*
* @param fileInfo
*/
function isEnabled(fileInfo) {
if (fileInfo && !fileInfo.isDirectory()) {

View file

@ -23,6 +23,7 @@ const getClientKey = (headers: object) => JSON.stringify(headers)
/**
*
* @param headers
*/
function getClient(headers: object = {}) {
const clientKey = getClientKey(headers)
@ -71,6 +72,7 @@ async function getPersonalCalendars(): Promise<DavCalendar[]> {
/**
*
* @param url
*/
function convertUrlToUri(url: string): string {
return url.replace(/\/$/gi, '').split('/').pop() || url

View file

@ -15,6 +15,9 @@ import { generateOcsUrl } from '@nextcloud/router'
/**
*
* @param token
* @param isDarkTheme
* @param avatarVersion
*/
function getConversationAvatarOcsUrl(token: string, isDarkTheme: boolean, avatarVersion?: string): string {
return generateOcsUrl('apps/spreed/api/v1/room/{token}/avatar' + (isDarkTheme ? '/dark' : '') + (avatarVersion ? '?v={avatarVersion}' : ''), { token, avatarVersion })
@ -22,6 +25,10 @@ function getConversationAvatarOcsUrl(token: string, isDarkTheme: boolean, avatar
/**
*
* @param token
* @param cloudId
* @param isDarkTheme
* @param size
*/
function getUserProxyAvatarOcsUrl(token: string, cloudId: string, isDarkTheme: boolean, size: 64 | 512 = 512): string {
return generateOcsUrl('apps/spreed/api/v1/proxy/{token}/user-avatar/{size}' + (isDarkTheme ? '/dark' : '') + '?cloudId={cloudId}', { token, cloudId, size })
@ -29,6 +36,8 @@ function getUserProxyAvatarOcsUrl(token: string, cloudId: string, isDarkTheme: b
/**
*
* @param token
* @param file
*/
async function setConversationAvatar(token: string, file: File): setFileAvatarResponse {
return axios.post(generateOcsUrl('apps/spreed/api/v1/room/{token}/avatar', { token }), file)
@ -36,6 +45,9 @@ async function setConversationAvatar(token: string, file: File): setFileAvatarRe
/**
*
* @param token
* @param emoji
* @param color
*/
async function setConversationEmojiAvatar(token: string, emoji: string, color?: string | null): setEmojiAvatarResponse {
return axios.post(generateOcsUrl('apps/spreed/api/v1/room/{token}/avatar/emoji', { token }), {
@ -46,6 +58,7 @@ async function setConversationEmojiAvatar(token: string, emoji: string, color?:
/**
*
* @param token
*/
async function deleteConversationAvatar(token: string): deleteAvatarResponse {
return axios.delete(generateOcsUrl('apps/spreed/api/v1/room/{token}/avatar', { token }))

View file

@ -57,6 +57,8 @@ async function leaveCall(token: string, all: boolean = false) {
/**
*
* @param token
* @param options
*/
async function fetchPeers(token: string, options: object): fetchPeersResponse {
return await axios.get(generateOcsUrl('apps/spreed/api/v4/call/{token}', { token }), options)

View file

@ -74,6 +74,8 @@ async function autocompleteQuery({
/**
*
* @param userId
* @param options
*/
async function getUserProfile(userId: string, options?: AxiosRequestConfig): UserProfileResponse {
return axios.get(generateOcsUrl('profile/{userId}', { userId }), options)
@ -81,6 +83,8 @@ async function getUserProfile(userId: string, options?: AxiosRequestConfig): Use
/**
*
* @param id
* @param options
*/
async function getTaskById(id: number, options?: AxiosRequestConfig): TaskProcessingResponse {
return axios.get(generateOcsUrl('taskprocessing/task/{id}', { id }), options)
@ -88,6 +92,8 @@ async function getTaskById(id: number, options?: AxiosRequestConfig): TaskProces
/**
*
* @param id
* @param options
*/
async function deleteTaskById(id: number, options?: AxiosRequestConfig): Promise<null> {
return axios.delete(generateOcsUrl('taskprocessing/task/{id}', { id }), options)
@ -95,6 +101,8 @@ async function deleteTaskById(id: number, options?: AxiosRequestConfig): Promise
/**
*
* @param params
* @param options
*/
async function searchMessages(params: SearchMessagePayload, options?: AxiosRequestConfig): UnifiedSearchResponse {
return axios.get(generateOcsUrl('search/providers/talk-message-current/search'), {

View file

@ -137,6 +137,7 @@ async function getMessageContext({ token, messageId, threadId, limit = 50 }: Get
* @param payload.referenceId A reference id to identify the message later again
* @param payload.replyTo The message id to be replied to
* @param payload.silent whether the message should trigger a notifications
* @param payload.threadTitle
* @param [options] Axios request options
*/
async function postNewMessage({

View file

@ -114,6 +114,8 @@ async function removeCurrentUserFromConversation(token) {
/**
*
* @param token
* @param attendeeId
*/
async function removeAttendeeFromConversation(token, attendeeId) {
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v4/room/{token}/attendees', { token }), {
@ -126,6 +128,8 @@ async function removeAttendeeFromConversation(token, attendeeId) {
/**
*
* @param token
* @param options
*/
async function promoteToModerator(token, options) {
const response = await axios.post(generateOcsUrl('apps/spreed/api/v4/room/{token}/moderators', { token }), options)
@ -134,6 +138,8 @@ async function promoteToModerator(token, options) {
/**
*
* @param token
* @param options
*/
async function demoteFromModerator(token, options) {
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v4/room/{token}/moderators', { token }), {
@ -144,6 +150,8 @@ async function demoteFromModerator(token, options) {
/**
*
* @param token
* @param options
*/
async function fetchParticipants(token, options) {
options = options || {}
@ -155,6 +163,8 @@ async function fetchParticipants(token, options) {
/**
*
* @param token
* @param userName
*/
async function setGuestUserName(token, userName) {
const response = await axios.post(generateOcsUrl('apps/spreed/api/v1/guest/{token}/name', { token }), {

View file

@ -17,6 +17,10 @@ import { generateOcsUrl } from '@nextcloud/router'
/**
*
* @param token
* @param messageId
* @param selectedEmoji
* @param options
*/
async function addReactionToMessage(token: string, messageId: number, selectedEmoji: addReactionParams['reaction'], options?: AxiosRequestConfig): addReactionResponse {
return axios.post(generateOcsUrl('apps/spreed/api/v1/reaction/{token}/{messageId}', { token, messageId }), {
@ -26,6 +30,10 @@ async function addReactionToMessage(token: string, messageId: number, selectedEm
/**
*
* @param token
* @param messageId
* @param selectedEmoji
* @param options
*/
async function removeReactionFromMessage(token: string, messageId: number, selectedEmoji: deleteReactionParams['reaction'], options?: AxiosRequestConfig): deleteReactionResponse {
return axios.delete(generateOcsUrl('apps/spreed/api/v1/reaction/{token}/{messageId}', { token, messageId }), {
@ -38,6 +46,9 @@ async function removeReactionFromMessage(token: string, messageId: number, selec
/**
*
* @param token
* @param messageId
* @param options
*/
async function getReactionsDetails(token: string, messageId: number, options?: AxiosRequestConfig): getReactionsResponse {
return axios.get(generateOcsUrl('apps/spreed/api/v1/reaction/{token}/{messageId}', { token, messageId }), options)

View file

@ -70,6 +70,8 @@ async function setSIPSettings({ sipGroups, sharedSecret, dialInInfo }: setSipSet
/**
*
* @param hasUserAccount
* @param value
*/
async function setPlaySounds(hasUserAccount: boolean, value: 'yes' | 'no') {
if (hasUserAccount) {
@ -84,6 +86,7 @@ async function setPlaySounds(hasUserAccount: boolean, value: 'yes' | 'no') {
/**
*
* @param value
*/
async function setStartWithoutMedia(value: boolean) {
return setUserConfig('spreed', 'calls_start_without_media', value ? 'yes' : 'no')
@ -91,6 +94,7 @@ async function setStartWithoutMedia(value: boolean) {
/**
*
* @param value
*/
async function setBlurVirtualBackground(value: boolean) {
return setUserConfig('spreed', 'blur_virtual_background', value ? 'yes' : 'no')
@ -98,6 +102,7 @@ async function setBlurVirtualBackground(value: boolean) {
/**
*
* @param value
*/
async function setConversationsListStyle(value: string) {
return setUserConfig('spreed', 'conversations_list_style', value)

View file

@ -13,10 +13,12 @@ import type {
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'
// Returns the last n shared items for each category and for a given conversation
// (n = limit)
/**
* Returns the last N (N = limit param) shared items for each category and for a given conversation
*
* @param payload
* @param payload.token
* @param payload.limit
*/
async function getSharedItemsOverview({ token, limit }: { token: string } & getSharedItemsOverviewParams): getSharedItemsOverviewResponse {
return axios.get(generateOcsUrl('apps/spreed/api/v1/chat/{token}/share/overview', {
@ -32,6 +34,11 @@ async function getSharedItemsOverview({ token, limit }: { token: string } & getS
// of shared item
/**
*
* @param payload
* @param payload.token
* @param payload.objectType
* @param payload.lastKnownMessageId
* @param payload.limit
*/
async function getSharedItems({ token, objectType, lastKnownMessageId, limit }: { token: string } & getSharedItemsParams): getSharedItemsResponse {
return axios.get(generateOcsUrl('apps/spreed/api/v1/chat/{token}/share', {

View file

@ -22,6 +22,8 @@ async function fetchSignalingSettings({ token }, options) {
/**
*
* @param token
* @param options
*/
async function pullSignalingMessages(token, options) {
return axios.get(generateOcsUrl('apps/spreed/api/v3/signaling/{token}', { token }), options)
@ -29,6 +31,7 @@ async function pullSignalingMessages(token, options) {
/**
*
* @param serverId
*/
async function getWelcomeMessage(serverId) {
return axios.get(generateOcsUrl('apps/spreed/api/v3/signaling/welcome/{serverId}', { serverId }))

View file

@ -8,6 +8,7 @@ import { generateOcsUrl } from '@nextcloud/router'
/**
*
* @param options
*/
async function getTranslationLanguages(options) {
return axios.get(generateOcsUrl('/translation/languages'), options)
@ -15,6 +16,10 @@ async function getTranslationLanguages(options) {
/**
*
* @param text
* @param fromLanguage
* @param toLanguage
* @param options
*/
async function translateText(text, fromLanguage, toLanguage, options) {
return axios.post(generateOcsUrl('/translation/translate'), {

View file

@ -1133,9 +1133,9 @@ const actions = {
* Grant all permissions for a given participant.
*
* @param {object} context - the context object.
* @param {object} root0 - the arguments object.
* @param {string} root0.token - the conversation token.
* @param {string} root0.attendeeId - the participant-s attendeeId.
* @param {object} payload - the arguments object.
* @param {string} payload.token - the conversation token.
* @param {string} payload.attendeeId - the participant-s attendeeId.
*/
async grantAllPermissionsToParticipant(context, { token, attendeeId }) {
await grantAllPermissionsToParticipant(token, attendeeId)
@ -1150,9 +1150,9 @@ const actions = {
* Remove all permissions for a given participant.
*
* @param {object} context - the context object.
* @param {object} root0 - the arguments object.
* @param {string} root0.token - the conversation token.
* @param {string} root0.attendeeId - the participant-s attendeeId.
* @param {object} payload - the arguments object.
* @param {string} payload.token - the conversation token.
* @param {string} payload.attendeeId - the participant-s attendeeId.
*/
async removeAllPermissionsFromParticipant(context, { token, attendeeId }) {
await removeAllPermissionsFromParticipant(token, attendeeId)
@ -1168,11 +1168,11 @@ const actions = {
* participant.
*
* @param {object} context - the context object.
* @param {object} root0 - the arguments object.
* @param {string} root0.token - the conversation token.
* @param {string} root0.attendeeId - the participant-s attendeeId.
* @param {'set'|'add'|'remove'} [root0.method] permissions update method
* @param {number} root0.permissions - bitwise combination of the permissions.
* @param {object} payload - the arguments object.
* @param {string} payload.token - the conversation token.
* @param {string} payload.attendeeId - the participant-s attendeeId.
* @param {'set'|'add'|'remove'} [payload.method] permissions update method
* @param {number} payload.permissions - bitwise combination of the permissions.
*/
async setPermissions(context, { token, attendeeId, method, permissions }) {
await setPermissions(token, attendeeId, method, permissions)

View file

@ -79,6 +79,8 @@ export const useActorStore = defineStore('actor', () => {
* Check if the message is from the current actor
*
* @param payload object to check for
* @param payload.actorId
* @param payload.actorType
*/
function checkIfSelfIsActor(payload: { actorId?: string, actorType?: string }) {
return payload.actorId === actorId.value

View file

@ -175,6 +175,7 @@ export const useCallViewStore = defineStore('callView', {
},
/**
* @param token
* @throws error if live transcription could not be enabled.
*/
async enableLiveTranscription(token: string) {
@ -190,6 +191,7 @@ export const useCallViewStore = defineStore('callView', {
},
/**
* @param token
* @throws error if live transcription could not be enabled.
*/
async disableLiveTranscription(token: string) {

View file

@ -32,6 +32,9 @@ type ProcessChatBlocksOptions = {
/**
* Check, if two sets intersect with each other
* Same complexity and result as !Set.prototype.isDisjointFrom()
*
* @param parentBlock
* @param childBlock
*/
function checkIfIntersect(parentBlock: Set<number>, childBlock: Set<number>): boolean {
for (const id of childBlock) {
@ -45,6 +48,8 @@ function checkIfIntersect(parentBlock: Set<number>, childBlock: Set<number>): bo
/**
* Return an array of only numeric ids from given set
* (temporary messages have a string id)
*
* @param block
*/
function filterNumericIds(block: Set<number | string>): number[] {
return Array.from(block).filter((id): id is number => Number.isInteger(id))
@ -61,6 +66,11 @@ export const useChatStore = defineStore('chat', () => {
/**
* Returns list of messages, belonging to current context
*
* @param token
* @param payload
* @param payload.messageId
* @param payload.threadId
*/
function getMessagesList(
token: string,
@ -89,6 +99,10 @@ export const useChatStore = defineStore('chat', () => {
/**
* Returns list of messages from given set
*
* @param token
* @param block
* @param threadId
*/
function prepareMessagesList(token: string, block: Set<number>, threadId?: number): ChatMessage[] {
return Array.from(block).sort((a, b) => a - b)
@ -112,6 +126,11 @@ export const useChatStore = defineStore('chat', () => {
/**
* Returns whether message is known in any of blocks (then it exists in store)
*
* @param token
* @param payload
* @param payload.messageId
* @param payload.threadId
*/
function hasMessage(
token: string,
@ -133,6 +152,11 @@ export const useChatStore = defineStore('chat', () => {
/**
* Returns first known message id, belonging to current context. Defaults to given messageId
*
* @param token
* @param payload
* @param payload.messageId
* @param payload.threadId
*/
function getFirstKnownId(
token: string,
@ -161,6 +185,11 @@ export const useChatStore = defineStore('chat', () => {
/**
* Returns last known message id, belonging to current context. Defaults to given messageId
*
* @param token
* @param payload
* @param payload.messageId
* @param payload.threadId
*/
function getLastKnownId(
token: string,
@ -189,6 +218,10 @@ export const useChatStore = defineStore('chat', () => {
/**
* Populate chat blocks from given arrays of messages
* If blocks already exist, try to extend them
*
* @param token
* @param messages
* @param options
*/
function processChatBlocks(token: string, messages: ChatMessage[], options?: ProcessChatBlocksOptions): void {
const threadIdSetsToUpdate: IdMap<Set<number>> = {}
@ -238,6 +271,11 @@ export const useChatStore = defineStore('chat', () => {
/**
* Populate chat blocks from given arrays of messages
* If blocks already exist, try to extend them
*
* @param token
* @param threadId
* @param threadMessagesSet
* @param options
*/
function processThreadBlocks(token: string, threadId: string | number, threadMessagesSet: Set<number>, options?: ProcessChatBlocksOptions): void {
if (!threadBlocks[token]) {
@ -259,6 +297,9 @@ export const useChatStore = defineStore('chat', () => {
/**
* Check, if blocks are intersecting with each other, and merge them in this case
* Otherwise, sort them to expected position (sorted by max id in set)
*
* @param blocks
* @param unsortedBlock
*/
function mergeAndSortChatBlocks(blocks: Set<number>[] | undefined, unsortedBlock: Set<number>): Set<number>[] {
if (!blocks || blocks.length === 0) {
@ -298,6 +339,9 @@ export const useChatStore = defineStore('chat', () => {
/**
* Check, if child block is intersecting with parent, and extend parent in this case
* Returns true if parent was extended, false otherwise
*
* @param parentBlock
* @param childBlock
*/
function tryMergeBlocks(parentBlock: Set<number>, childBlock: Set<number>): boolean {
if (checkIfIntersect(parentBlock, childBlock)) {
@ -313,6 +357,9 @@ export const useChatStore = defineStore('chat', () => {
/**
* Adds the message id to the main chat block
* (It is expected to appear in most recent one)
*
* @param token
* @param message
*/
function addMessageToChatBlocks(token: string, message: ChatMessage) {
if (!chatBlocks[token]) {
@ -336,6 +383,9 @@ export const useChatStore = defineStore('chat', () => {
/**
* Removes one or more message ids from all chat blocks
*
* @param token
* @param messageIds
*/
function removeMessagesFromChatBlocks(token: string, messageIds: number | number[]) {
if (!chatBlocks[token]) {
@ -380,6 +430,9 @@ export const useChatStore = defineStore('chat', () => {
/**
* Clears the messages entry from the store for the given token starting from defined id
*
* @param token
* @param idToDelete
*/
function clearMessagesHistory(token: string, idToDelete: number) {
if (!chatBlocks[token]) {
@ -431,6 +484,8 @@ export const useChatStore = defineStore('chat', () => {
/**
* Clears the store for the given token
*
* @param token
*/
function purgeChatStore(token: string) {
delete chatBlocks[token]

View file

@ -288,9 +288,8 @@ export const useChatExtrasStore = defineStore('chatExtras', {
/**
* Add a thread title to the store
*
* @param payload action payload
* @param payload.token - conversation token
* @param payload.title - title from input
* @param token - conversation token
* @param title - title from input
*/
setThreadTitle(token: string, title: string) {
this.threadTitle[token] = title

View file

@ -111,9 +111,9 @@ export const usePollsStore = defineStore('polls', {
* poll data every time someone votes, so we create a debounce
* function for each poll and store it in the pollStore
*
* @param root0 The arguments passed to the action
* @param root0.token The token of the conversation
* @param root0.pollId The id of the poll
* @param payload The arguments passed to the action
* @param payload.token The token of the conversation
* @param payload.pollId The id of the poll
*/
debounceGetPollData({ token, pollId }: { token: string, pollId: string }) {
if (!this.debouncedFunctions[token]) {

View file

@ -5,6 +5,7 @@
/**
*
* @param app
*/
export function NextcloudGlobalsVuePlugin(app) {
app.config.globalProperties.OC = window.OC

View file

@ -8,6 +8,7 @@ const timersPool: Record<string, number> = {}
/**
*
* @param time
*/
function getReadable(time: number) {
if (isNaN(time)) {

View file

@ -40,6 +40,8 @@ export default class Deferred {
/**
* Rejects the promise after the given timeout.
*
* @param ms
*/
setRejectTimeout(ms) {
this._timeout = setTimeout(() => {

View file

@ -28,7 +28,8 @@ export default class E2EEcontext {
/**
* Build a new E2EE context instance, which will be used in a given conference.
*
* @param {boolean} [options.sharedKey] - whether there is a uniques key shared amoung all participants.
* @param payload
* @param [payload.sharedKey] - whether there is a uniques key shared amoung all participants.
*/
constructor({ sharedKey } = {}) {
this._worker = new Worker()

View file

@ -42,6 +42,7 @@ const RATCHET_WINDOW_SIZE = 8
export class Context {
/**
* @param {Object} options
* @param options.sharedKey
*/
constructor({ sharedKey = false } = {}) {
// An array (ring) of keys that we use for sending and receiving.
@ -208,6 +209,7 @@ export class Context {
*
* @param {RTCEncodedVideoFrame|RTCEncodedAudioFrame} encodedFrame - Encoded video frame.
* @param {number} keyIndex - the index of the decryption data in _cryptoKeyRing array.
* @param initialKey
* @param {number} ratchetCount - the number of retries after ratcheting the key.
* @returns {Promise<RTCEncodedVideoFrame|RTCEncodedAudioFrame>} - The decrypted frame.
* @private
@ -308,13 +310,16 @@ export class Context {
* There is no XOR with a salt. Note that this IV leaks the SSRC to the receiver but since this is
* randomly generated and SFUs may not rewrite this is considered acceptable.
* The SSRC is used to allow demultiplexing multiple streams with the same key, as described in
* https://tools.ietf.org/html/rfc3711#section-4.1.1
* https://tools.ietf.org/html/rfc3711#section-4.1.1
* The RTP timestamp is 32 bits and advances by the codec clock rate (90khz for video, 48khz for
* opus audio) every second. For video it rolls over roughly every 13 hours.
* The send counter will advance at the frame rate (30fps for video, 50fps for 20ms opus audio)
* every second. It will take a long time to roll over.
*
* See also https://developer.mozilla.org/en-US/docs/Web/API/AesGcmParams
*
* @param synchronizationSource
* @param timestamp
*/
_makeIV(synchronizationSource, timestamp) {
const iv = new ArrayBuffer(IV_LENGTH)

View file

@ -8,6 +8,7 @@ import { MESSAGE, SHARED_ITEM } from '../constants.ts'
/**
*
* @param message
*/
export function getItemTypeFromMessage(message: ChatMessage): string {
if (message.messageParameters?.object) {

View file

@ -18,6 +18,7 @@ import { MESSAGE } from '../constants.ts'
/**
*
* @param lastMessage
*/
export function getMessageIcon(lastMessage: Conversation['lastMessage']): ComponentPublicInstance | null {
if (!lastMessage || Array.isArray(lastMessage)) {

View file

@ -44,6 +44,9 @@ export type PrepareTemporaryMessagePayload = Pick<ChatMessage,
* @param payload.actorType actor type
* @param payload.actorDisplayName actor displayed name
* @param [payload.parent] parent message
* @param payload.silent
* @param payload.threadId
* @param payload.isThread
*/
export function prepareTemporaryMessage({
message,

View file

@ -8,6 +8,8 @@
// getScreenMedia helper by @HenrikJoreteg
/**
*
* @param constraints
* @param callback
*/
function getUserMedia(constraints, callback) {
if (!window.navigator || !window.navigator.mediaDevices || !window.navigator.mediaDevices.getUserMedia) {