refator: change comments
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Vicent Llopis 2022-06-03 13:44:42 +02:00
parent fa27e6dd58
commit 9f57481390
3 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,6 @@
module.exports = Self => {
Self.remoteMethodCtx('send', {
description: 'Send a RocketChat message',
description: 'Insert in model Chat',
accessType: 'WRITE',
accepts: [{
arg: 'to',

View File

@ -1,6 +1,6 @@
module.exports = Self => {
Self.remoteMethodCtx('sendCheckingPresence', {
description: 'Sends a RocketChat message to a connected user or department channel',
description: 'Insert in model Chat',
accessType: 'WRITE',
accepts: [{
arg: 'workerId',

View File

@ -14,7 +14,7 @@ module.exports = Self => {
}
});
Self.sendQueued = async ctx => {
Self.sendQueued = async() => {
const models = Self.app.models;
const maxAttempts = 3;
const sentStatus = 1;
@ -46,6 +46,12 @@ module.exports = Self => {
}
};
/**
* Check user status in Rocket
*
* @param {object} chat - The sender id
* @return {Promise} - The request promise
*/
Self.sendCheckingUserStatus = async function sendCheckingUserStatus(chat) {
const models = Self.app.models;
@ -78,7 +84,7 @@ module.exports = Self => {
};
/**
* Update status and attempts of a chat
* Send a rocket message
*
* @param {object} senderFk - The sender id
* @param {string} recipient - The user (@) or channel (#) to send the message