diff options
author | Joas Schilling <coding@schilljs.com> | 2021-08-30 15:20:19 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-08-30 15:20:19 +0200 |
commit | d1873a40d5bfe383b5449c2a709717f000c72cbd (patch) | |
tree | 3bb17ff7f9eb12e865ed0b62efa657c66ae142ab | |
parent | f307272c53cf36489a7743605411b0eea6661430 (diff) |
Fix stores and some other basics
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | src/components/MessagesList/MessagesGroup/MessagesGroup.vue | 2 | ||||
-rw-r--r-- | src/components/NewMessageForm/NewMessageForm.vue | 2 | ||||
-rw-r--r-- | src/deck.js | 4 | ||||
-rw-r--r-- | src/init.js | 8 | ||||
-rw-r--r-- | src/services/conversationsService.js | 7 | ||||
-rw-r--r-- | src/services/filesIntegrationServices.js | 5 | ||||
-rw-r--r-- | src/services/messagesService.js | 29 | ||||
-rw-r--r-- | src/services/participantsService.js | 5 | ||||
-rw-r--r-- | src/services/publicShareAuthService.js | 1 |
9 files changed, 32 insertions, 31 deletions
diff --git a/src/components/MessagesList/MessagesGroup/MessagesGroup.vue b/src/components/MessagesList/MessagesGroup/MessagesGroup.vue index 64492cdc8..24ae3b5ca 100644 --- a/src/components/MessagesList/MessagesGroup/MessagesGroup.vue +++ b/src/components/MessagesList/MessagesGroup/MessagesGroup.vue @@ -155,7 +155,7 @@ export default { /** * Whether the given message is a system message * - * @return {bool} + * @return {boolean} */ isSystemMessage() { return this.messages[0].systemMessage.length !== 0 diff --git a/src/components/NewMessageForm/NewMessageForm.vue b/src/components/NewMessageForm/NewMessageForm.vue index 03a90b0e1..4d9bdfde7 100644 --- a/src/components/NewMessageForm/NewMessageForm.vue +++ b/src/components/NewMessageForm/NewMessageForm.vue @@ -465,7 +465,7 @@ export default { * does not have the focus there will be no caret or selection; in that * case the emoji will be added at the end. * - * @param {Emoji} emoji Emoji object + * @param {string} emoji Emoji object */ addEmoji(emoji) { const selection = document.getSelection() diff --git a/src/deck.js b/src/deck.js index fdd3226fe..215b6bb20 100644 --- a/src/deck.js +++ b/src/deck.js @@ -30,8 +30,8 @@ import RoomSelector from './views/RoomSelector' (function(OC, OCA, t, n) { /** - * @param card - * @param token + * @param {object} card The card object given by the deck app + * @param {string} token The conversation to post to */ async function postCardToRoom(card, token) { try { diff --git a/src/init.js b/src/init.js index 3f0f959c5..e2789c323 100644 --- a/src/init.js +++ b/src/init.js @@ -33,12 +33,12 @@ if (!window.OCA.Talk) { /** * Frontend message API for adding actions to talk messages. * - * @param {*} Object the wrapping object. - * @param {string} label the action label. - * @param {Function} callback the callback function. This function will receive + * @param {object} data the wrapping object. + * @param {string} data.label the action label. + * @param {Function} data.callback the callback function. This function will receive * the messageAPIData object as a parameter and be triggered by a click on the * action. - * @param {string} icon the action label. E.g. "icon-reply" + * @param {string} data.icon the action label. E.g. "icon-reply" */ window.OCA.Talk.registerMessageAction = ({ label, callback, icon }) => { const messageAction = { diff --git a/src/services/conversationsService.js b/src/services/conversationsService.js index 203badd02..49cb4fb22 100644 --- a/src/services/conversationsService.js +++ b/src/services/conversationsService.js @@ -62,10 +62,11 @@ const searchListedConversations = async function({ searchText }, options) { /** * Fetch possible conversations * - * @param {string} searchText The string that will be used in the search query. + * @param {object} data the wrapping object. + * @param {string} data.searchText The string that will be used in the search query. + * @param {string} [data.token] The token of the conversation (if any), or "new" for a new one + * @param {boolean} [data.onlyUsers] Only return users * @param {object} options options - * @param {string} [token] The token of the conversation (if any), or "new" for a new one - * @param {boolean} [onlyUsers] Only return users */ const searchPossibleConversations = async function({ searchText, token, onlyUsers }, options) { token = token || 'new' diff --git a/src/services/filesIntegrationServices.js b/src/services/filesIntegrationServices.js index 1f33bf1bc..64c7a4aec 100644 --- a/src/services/filesIntegrationServices.js +++ b/src/services/filesIntegrationServices.js @@ -26,8 +26,8 @@ import { generateOcsUrl } from '@nextcloud/router' /** * Gets the conversation token for a given file id * - * @param {object} .fileId the id of the file - * @param options.fileId + * @param {object} data the wrapping object. + * @param {number} data.fileId The file id to get the conversation for * @param {object} options unused * @return {string} the conversation token */ @@ -41,7 +41,6 @@ const getFileConversation = async function({ fileId }, options) { * * @param {string} shareToken the token of the share * @return {string} the conversation token - * @throws {Exception} if the conversation token could not be got */ const getPublicShareConversationData = async function(shareToken) { const response = await axios.get(generateOcsUrl('apps/spreed/api/v1/publicshare/{shareToken}', { shareToken })) diff --git a/src/services/messagesService.js b/src/services/messagesService.js index 36ef166d7..849c881f0 100644 --- a/src/services/messagesService.js +++ b/src/services/messagesService.js @@ -29,9 +29,10 @@ import Hex from 'crypto-js/enc-hex' * Fetches messages that belong to a particular conversation * specified with its token. * - * @param {string} token the conversation token; - * @param {string} lastKnownMessageId last known message id; - * @param {boolean} includeLastKnown whether to include the last known message in the response; + * @param {object} data the wrapping object. + * @param {string} data.token the conversation token; + * @param {string} data.lastKnownMessageId last known message id; + * @param {boolean} data.includeLastKnown whether to include the last known message in the response; * @param {object} options options; */ const fetchMessages = async function({ token, lastKnownMessageId, includeLastKnown }, options) { @@ -49,9 +50,10 @@ const fetchMessages = async function({ token, lastKnownMessageId, includeLastKno * Fetches newly created messages that belong to a particular conversation * specified with its token. * - * @param {string} token The conversation token; + * @param {object} data the wrapping object. + * @param {number} data.lastKnownMessageId The id of the last message in the store. + * @param {string} data.token The conversation token; * @param {object} options options - * @param {number} lastKnownMessageId The id of the last message in the store. */ const lookForNewMessages = async ({ token, lastKnownMessageId }, options) => { return axios.get(generateOcsUrl('apps/spreed/api/v1/chat/{token}', { token }), Object.assign(options, { @@ -70,10 +72,10 @@ const lookForNewMessages = async ({ token, lastKnownMessageId }, options) => { * @param {object} param0 The message object that is destructured * @param {string} param0.token The conversation token * @param {string} param0.message The message object + * @param {string} param0.actorDisplayName The display name of the actor * @param {string} param0.referenceId A reference id to identify the message later again * @param {number} param0.parent The id of the message to be replied to * @param {object} options request options - * @param param0.actorDisplayName */ const postNewMessage = async function({ token, message, actorDisplayName, referenceId, parent }, options) { return axios.post(generateOcsUrl('apps/spreed/api/v1/chat/{token}', { token }), { @@ -88,10 +90,8 @@ const postNewMessage = async function({ token, message, actorDisplayName, refere * Deletes a message from the server. * * @param {object} param0 The message object that is destructured - * @param param0.token - * @param {string} token The conversation token - * @param {string} id The id of the message to be deleted - * @param param0.id + * @param {string} param0.token The conversation token + * @param {string} param0.id The id of the message to be deleted */ const deleteMessage = async function({ token, id }) { return axios.delete(generateOcsUrl('apps/spreed/api/v1/chat/{token}/{id}', { token, id })) @@ -101,10 +101,11 @@ const deleteMessage = async function({ token, id }) { * Post a rich object to a conversation * * @param {string} token conversation token - * @param {string} objectType object type - * @param {string} objectId object id - * @param {string} metaData JSON metadata of the rich object encoded as string - * @param {string} referenceId generated reference id, leave empty to generate it based on the other args + * @param {object} data the wrapping object. + * @param {string} data.objectType object type + * @param {string} data.objectId object id + * @param {string} data.metaData JSON metadata of the rich object encoded as string + * @param {string} data.referenceId generated reference id, leave empty to generate it based on the other args */ const postRichObjectToConversation = async function(token, { objectType, objectId, metaData, referenceId }) { if (!referenceId) { diff --git a/src/services/participantsService.js b/src/services/participantsService.js index a732ce439..3b50b54d8 100644 --- a/src/services/participantsService.js +++ b/src/services/participantsService.js @@ -33,9 +33,10 @@ import { * Joins the current user to a conversation specified with * the token. * - * @param {string} token The conversation token; + * @param {object} data the wrapping object. + * @param {string} data.token The conversation token; + * @param {boolean} data.forceJoin whether to force join; * @param {options} options request options; - * @param {boolean} forceJoin whether to force join; */ const joinConversation = async ({ token, forceJoin = false }, options) => { const response = await axios.post(generateOcsUrl('apps/spreed/api/v4/room/{token}/participants/active', { token }), { diff --git a/src/services/publicShareAuthService.js b/src/services/publicShareAuthService.js index 788a66acc..2b235b8f1 100644 --- a/src/services/publicShareAuthService.js +++ b/src/services/publicShareAuthService.js @@ -27,7 +27,6 @@ import { generateOcsUrl } from '@nextcloud/router' * * @param {string} shareToken the token of the share * @return {string} the conversation token - * @throws {Exception} if the conversation token could not be got */ const getPublicShareAuthConversationToken = async function(shareToken) { const response = await axios.post(generateOcsUrl('apps/spreed/api/v1/publicshareauth'), { |