bottoni fiducia

This commit is contained in:
Surya Paolo
2023-11-30 19:50:12 +01:00
parent e3ed2934ee
commit 8e42baf79e
5 changed files with 51 additions and 10 deletions

View File

@@ -96,4 +96,24 @@ PaoTEST1: 10 RIS]
Gio 12/10 ORE 08:06: [<b>Circuito RIS Rimini</b>]: Inviate Monete da paoloar77 a SuryaArena2 1 RIS [causale: ]
Saldi:
paoloar77: -18 RIS]
SuryaArena2: 7 RIS]
SuryaArena2: 7 RIS]
Mer 29/11 ORE 16:35: [<b>Circuito RIS Italia</b>]: Inviate Monete da SuryaArena a paoloar77 5 RIS [causale: Seconda]
Saldi:
SuryaArena: -5 RIS]
paoloar77: 5 RIS]
Mer 29/11 ORE 16:44: [<b>Circuito RIS Italia</b>]: Inviate Monete da SuryaArena a paoloar77 3 RIS [causale: Eccolo]
Saldi:
SuryaArena: -8 RIS]
paoloar77: 8 RIS]
Mer 29/11 ORE 16:50: [<b>Circuito RIS Italia</b>]: Inviate Monete da SuryaArena a paoloar77 3 RIS [causale: Ricevuto un bel massaggio]
Saldi:
SuryaArena: -11 RIS]
paoloar77: 11 RIS]
Mer 29/11 ORE 16:52: [<b>Circuito RIS Bologna</b>]: Inviate Monete da SuryaArena a paoloar77 4 RIS [causale: Un bel massaggio con olio caldo]
Saldi:
SuryaArena: -4 RIS]
paoloar77: 14 RIS]
Mer 29/11 ORE 17:14: [<b>Circuito RIS Italia</b>]: Inviate Monete da SuryaArena a paoloar77 2 RIS [causale: Massaggio !]
Saldi:
SuryaArena: -13 RIS]
paoloar77: 13 RIS]

View File

@@ -109,5 +109,9 @@
"SENDMSG_ENTRA_IN_RISO_ITALIA": "Ciao %s!<br>%s che appartiene al <em>%s</em> vuole inviarti dei RIS. Per poterli ricevere dovete entrambi utilizzare il <strong>Circuito RIS Italia</strong>.",
"CLICCA_QUI": "CLICCA QUI",
"✅ %s è stato Abilitato correttamente (da %s)!": "✅ %s è stato Abilitato correttamente (da %s)!",
"✅ Sei stato Abilitato correttamente da %s!": "✅ Sei stato Abilitato correttamente da %s!"
"✅ Sei stato Abilitato correttamente da %s!": "✅ Sei stato Abilitato correttamente da %s!",
"🚫 Hai rifiutato l'accesso alla App di RISO da parte di %s!": "🚫 Hai rifiutato l'accesso alla App di RISO da parte di %s!",
"🚫 Ti è stato rifiutato l'accesso. Probabilmente l'username con cui ti sei registrato non ti conosce. (%s) !<br>Contatta l'Assistenza Tecnica.": "🚫 Ti è stato rifiutato l'accesso. Probabilmente l'username con cui ti sei registrato non ti conosce. (%s) !<br>Contatta l'Assistenza Tecnica.",
"🚫 %s ha rifiutato l'accesso alla App a %s !": "🚫 %s ha rifiutato l'accesso alla App a %s !",
"✅ Hai Abilitato l'accesso alla App a %s !": "✅ Hai Abilitato l'accesso alla App a %s !"
}

View File

@@ -2076,22 +2076,33 @@ UserSchema.statics.setFriendsCmd = async function (req, idapp, usernameOrig, use
try {
if (cmd === shared_consts.FRIENDSCMD.SETTRUST) {
// Aggiungi alle amicizie
await this.setFriendsCmd(req, idapp, usernameOrig, usernameDest,
shared_consts.FRIENDSCMD.SETFRIEND, value);
let msgOrig = '';
let msgDest = '';
// Aggiorna true se lo accetti e false se non lo accetti
const ris = await User.updateOne({ idapp, username: usernameDest },
{ $set: { verified_by_aportador: value, trust_modified: new Date() } },
{ new: false });
const msgOrig = i18n.__({ phrase: '✅ %s è stato Abilitato correttamente (da %s)!', locale: userDest.lang }, userDest.username, usernameOrig);
const msgDest = i18n.__({ phrase: '✅ Sei stato Abilitato correttamente da %s!', locale: lang }, usernameOrig);
if (value) {
// Aggiungi alle amicizie
await this.setFriendsCmd(req, idapp, usernameOrig, usernameDest,
shared_consts.FRIENDSCMD.SETFRIEND, value);
msgOrig = i18n.__({ phrase: '✅ Hai Abilitato l\'accesso alla App a %s !', locale: userDest.lang }, userDest.username);
msgDest = i18n.__({ phrase: '✅ Sei stato Abilitato correttamente da %s!', locale: lang }, usernameOrig);
msgAdmin = i18n.__({ phrase: '✅ %s è stato Abilitato correttamente (da %s)!', locale: userDest.lang }, userDest.username, usernameOrig);
} else {
msgOrig = i18n.__({ phrase: '🚫 Hai rifiutato l\'accesso alla App di RISO da parte di %s!', locale: userDest.lang }, userDest.username);
msgDest = i18n.__({ phrase: '🚫 Ti è stato rifiutato l\'accesso. Probabilmente l\'username con cui ti sei registrato non ti conosce. (%s) !<br>Contatta l\'Assistenza Tecnica.', locale: lang }, usernameOrig);
msgAdmin = i18n.__({ phrase: '🚫 %s ha rifiutato l\'accesso alla App a %s !', locale: userDest.lang }, usernameOrig, userDest.username);
}
await telegrambot.sendMsgTelegram(idapp, usernameOrig, msgOrig);
await telegrambot.sendMsgTelegram(idapp, userDest.username, msgDest);
// Invia questo msg anche all'Admin
await telegrambot.sendMsgTelegramToTheAdmin(idapp, msgDest, true);
await telegrambot.sendMsgTelegramToTheAdmin(idapp, msgAdmin, true);
// telegrambot.askConfirmationUser(user.idapp, shared_consts.CallFunz.REGISTRATION, user, '', '', '', '');

View File

@@ -27,6 +27,8 @@ const shared_consts = require('./tools/shared_nodejs');
const {User} = require('./models/user');
const { MsgTemplate } = require('./models/msg_template');
const transport_preview = nodemailer.createTransport({
jsonTransport: true,
});
@@ -168,6 +170,9 @@ module.exports = {
// console.log('idapp', idapp, tools.getNomeAppByIdApp(idapp));
// ++ estrai l'html da mettere sulla email:
// const msghtml = await MsgTemplate.getMsgByLang(idapp, user, shared_consts.TypeMsgTemplate.MSG_BENV_REGISTRATO, user.lang);
let mylocalsconf = {
idapp,
dataemail: await this.getdataemail(idapp),

View File

@@ -411,6 +411,7 @@ module.exports = {
TypeMsgTemplate: {
MSG_BENVENUTO: 2010,
MS_SHARE_LINK: 2000,
MSG_BENV_REGISTRATO: 2020,
},
TypeSend: {