bottoni fiducia
This commit is contained in:
@@ -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 !"
|
||||
}
|
||||
@@ -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, '', '', '', '');
|
||||
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -411,6 +411,7 @@ module.exports = {
|
||||
TypeMsgTemplate: {
|
||||
MSG_BENVENUTO: 2010,
|
||||
MS_SHARE_LINK: 2000,
|
||||
MSG_BENV_REGISTRATO: 2020,
|
||||
},
|
||||
|
||||
TypeSend: {
|
||||
|
||||
Reference in New Issue
Block a user