Riso: Ris Italia, altre modifiche grafiche
Lista Utenti da Verificare
This commit is contained in:
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@@ -7,7 +7,7 @@
|
|||||||
"name": "Launch via Nodemon",
|
"name": "Launch via Nodemon",
|
||||||
"program": "${workspaceFolder}/node_modules/nodemon/bin/nodemon.js",
|
"program": "${workspaceFolder}/node_modules/nodemon/bin/nodemon.js",
|
||||||
"restart": true,
|
"restart": true,
|
||||||
"runtimeExecutable": "/Users/paolo/.nvm/versions/node/v16.19.0/bin/node",
|
"runtimeExecutable": "node",
|
||||||
"runtimeArgs": [
|
"runtimeArgs": [
|
||||||
"--inspect=9229" // Use "--inspect=0.0.0.0:9229" for remote debugging
|
"--inspect=9229" // Use "--inspect=0.0.0.0:9229" for remote debugging
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
"CIRCUIT_EXIT_USER": "❌ l'utente %s è uscito dal '%s'",
|
"CIRCUIT_EXIT_USER": "❌ l'utente %s è uscito dal '%s'",
|
||||||
"CIRCUIT_EXIT_USER_TO_ME": "❌ Sei uscito dal '%s'",
|
"CIRCUIT_EXIT_USER_TO_ME": "❌ Sei uscito dal '%s'",
|
||||||
"CIRCUIT_REMOVED_TO_ME": "❌ Sei stato rimosso dal '%s' (da parte di %s)",
|
"CIRCUIT_REMOVED_TO_ME": "❌ Sei stato rimosso dal '%s' (da parte di %s)",
|
||||||
"CIRCUIT_SENDCOINSREQ": "%s ti sta inviando <strong>%s %s</strong> sul '%s'.",
|
"CIRCUIT_SENDCOINSREQ": "%s ti sta inviando <strong>%s %s</strong> sul <strong>'%s'</strong>",
|
||||||
"COMUNITARIO": "Comunitario",
|
"COMUNITARIO": "Comunitario",
|
||||||
"COLLETTIVO": "Gruppo",
|
"COLLETTIVO": "Gruppo",
|
||||||
"CIRCUIT_SENDCOINSREQ_GROUP": "%s sta inviando <strong>%s %s</strong> al Conto %s '%s' sul '%s'.",
|
"CIRCUIT_SENDCOINSREQ_GROUP": "%s sta inviando <strong>%s %s</strong> al Conto %s '%s' sul '%s'.",
|
||||||
@@ -107,5 +107,7 @@
|
|||||||
"DATEDAYONLY": "%s dalle %s alle %s",
|
"DATEDAYONLY": "%s dalle %s alle %s",
|
||||||
"DATE_2DAYS": "%s dalle %s fino a %s alle %s",
|
"DATE_2DAYS": "%s dalle %s fino a %s alle %s",
|
||||||
"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>.",
|
"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"
|
"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!"
|
||||||
}
|
}
|
||||||
@@ -1011,7 +1011,6 @@ sendNotifSchema.statics.sendToTheDestinations = async function (myrecnotifpass,
|
|||||||
arrcircuits.push(await City.getCircuitNameBystrProv(prov));
|
arrcircuits.push(await City.getCircuitNameBystrProv(prov));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (myrecnotifpass.tablerec === shared_consts.TABLES_MYGOODS) {
|
if (myrecnotifpass.tablerec === shared_consts.TABLES_MYGOODS) {
|
||||||
idSector = myrectableorig.idSectorGood;
|
idSector = myrectableorig.idSectorGood;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ const validator = require('validator');
|
|||||||
const jwt = require('jsonwebtoken');
|
const jwt = require('jsonwebtoken');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
|
|
||||||
|
const printf = require('util').format;
|
||||||
const tools = require('../tools/general');
|
const tools = require('../tools/general');
|
||||||
|
|
||||||
const { Settings } = require('../models/settings');
|
const { Settings } = require('../models/settings');
|
||||||
@@ -2057,10 +2058,20 @@ UserSchema.statics.setFriendsCmd = async function (req, idapp, usernameOrig, use
|
|||||||
req = tools.getReqByPar(idapp, usernameOrig);
|
req = tools.getReqByPar(idapp, usernameOrig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let userDest = null;
|
||||||
|
if (usernameDest)
|
||||||
|
userDest = await User.getUserShortDataByUsername(idapp, usernameDest);
|
||||||
|
|
||||||
const username_action = req.user.username;
|
const username_action = req.user.username;
|
||||||
let username_worked = usernameDest;
|
let username_worked = usernameDest;
|
||||||
|
|
||||||
let ris = null;
|
let ris = null;
|
||||||
|
let lang = '';
|
||||||
|
let user = null;
|
||||||
|
if (usernameOrig) {
|
||||||
|
user = await User.getUserShortDataByUsername(idapp, usernameOrig);
|
||||||
|
}
|
||||||
|
lang = user ? user.lang : '';
|
||||||
let update = {};
|
let update = {};
|
||||||
try {
|
try {
|
||||||
if (cmd === shared_consts.FRIENDSCMD.SETTRUST) {
|
if (cmd === shared_consts.FRIENDSCMD.SETTRUST) {
|
||||||
@@ -2069,10 +2080,23 @@ UserSchema.statics.setFriendsCmd = async function (req, idapp, usernameOrig, use
|
|||||||
await this.setFriendsCmd(req, idapp, usernameOrig, usernameDest,
|
await this.setFriendsCmd(req, idapp, usernameOrig, usernameDest,
|
||||||
shared_consts.FRIENDSCMD.SETFRIEND, value);
|
shared_consts.FRIENDSCMD.SETFRIEND, value);
|
||||||
|
|
||||||
return await User.updateOne({ idapp, username: usernameDest },
|
const ris = await User.updateOne({ idapp, username: usernameDest },
|
||||||
{ $set: { verified_by_aportador: value, trust_modified: new Date() } },
|
{ $set: { verified_by_aportador: value, trust_modified: new Date() } },
|
||||||
{ new: false });
|
{ 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);
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
// telegrambot.askConfirmationUser(user.idapp, shared_consts.CallFunz.REGISTRATION, user, '', '', '', '');
|
||||||
|
|
||||||
|
return ris;
|
||||||
|
|
||||||
} else if (cmd === shared_consts.FRIENDSCMD.SETFRIEND) {
|
} else if (cmd === shared_consts.FRIENDSCMD.SETFRIEND) {
|
||||||
// Aggiungo l'Amicizia a me
|
// Aggiungo l'Amicizia a me
|
||||||
const foundIfAlreadyFriend = await User.findOne({
|
const foundIfAlreadyFriend = await User.findOne({
|
||||||
@@ -3125,6 +3149,20 @@ UserSchema.statics.getAskedFriendsByUsername = async function (idapp, username)
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
UserSchema.statics.getUsersToVerify = async function (idapp, username) {
|
||||||
|
|
||||||
|
const whatToShow_Unknown = getWhatToShow(idapp, username);
|
||||||
|
let usersToVerify = await User.find({
|
||||||
|
idapp, aportador_solidario: username,
|
||||||
|
verified_by_aportador: { $exists: false },
|
||||||
|
$or: [
|
||||||
|
{ deleted: { $exists: false } },
|
||||||
|
{ deleted: { $exists: true, $eq: false } }],
|
||||||
|
}, whatToShow_Unknown).lean();
|
||||||
|
|
||||||
|
return usersToVerify;
|
||||||
|
};
|
||||||
|
|
||||||
UserSchema.statics.getFriendsByUsername = async function (idapp, username) {
|
UserSchema.statics.getFriendsByUsername = async function (idapp, username) {
|
||||||
|
|
||||||
if (!username) {
|
if (!username) {
|
||||||
@@ -4076,7 +4114,7 @@ UserSchema.statics.getUsersDreams = async function (idapp) {
|
|||||||
UserSchema.statics.getLastUsers = async function (idapp) {
|
UserSchema.statics.getLastUsers = async function (idapp) {
|
||||||
const User = this;
|
const User = this;
|
||||||
|
|
||||||
const lastn = await Settings.getValDbSettings(idapp, 'SHOW_LAST_N_USERS', 10);
|
const lastn = await Settings.getValDbSettings(idapp, 'SHOW_LAST_N_USERS', 20);
|
||||||
|
|
||||||
return await User.find(
|
return await User.find(
|
||||||
{
|
{
|
||||||
@@ -4090,6 +4128,7 @@ UserSchema.statics.getLastUsers = async function (idapp) {
|
|||||||
name: 1,
|
name: 1,
|
||||||
surname: 1,
|
surname: 1,
|
||||||
lasttimeonline: 1,
|
lasttimeonline: 1,
|
||||||
|
verified_by_aportador: 1,
|
||||||
'profile.img': 1,
|
'profile.img': 1,
|
||||||
date_reg: 1,
|
date_reg: 1,
|
||||||
index: 1,
|
index: 1,
|
||||||
@@ -5024,6 +5063,8 @@ UserSchema.statics.addExtraInfo = async function (idapp, recUser, recUserSave, v
|
|||||||
|
|
||||||
recUser.profile.reaction = await Reaction.find({ idapp, username: recUser.username }).lean();
|
recUser.profile.reaction = await Reaction.find({ idapp, username: recUser.username }).lean();
|
||||||
|
|
||||||
|
recUser.profile.userstoverify = await User.getUsersToVerify(idapp, recUser.username);
|
||||||
|
|
||||||
recUser.profile.manage_mygroups = listManageGroups
|
recUser.profile.manage_mygroups = listManageGroups
|
||||||
? listManageGroups
|
? listManageGroups
|
||||||
: [];
|
: [];
|
||||||
|
|||||||
@@ -893,6 +893,8 @@ const MyTelegramBot = {
|
|||||||
}, */
|
}, */
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
send_notif = true;
|
||||||
|
|
||||||
} else if (myfunc === shared_consts.CallFunz.RICHIESTA_GRUPPO) {
|
} else if (myfunc === shared_consts.CallFunz.RICHIESTA_GRUPPO) {
|
||||||
|
|
||||||
domanda = printf(getstr(langdest, 'MSG_ACCEPT_NEWENTRY_INGROUP'), name) + '<br>' + struserinfomsg;
|
domanda = printf(getstr(langdest, 'MSG_ACCEPT_NEWENTRY_INGROUP'), name) + '<br>' + struserinfomsg;
|
||||||
@@ -924,6 +926,8 @@ const MyTelegramBot = {
|
|||||||
groupid + tools.SEP + groupname,
|
groupid + tools.SEP + groupname,
|
||||||
},*/
|
},*/
|
||||||
]);
|
]);
|
||||||
|
send_notif = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
domanda = i18n.__({ phrase: 'CIRCUIT_ACCEPT_NEWENTRY', locale: langdest }, myuser.username, name) + '<br>' + struserinfomsg;
|
domanda = i18n.__({ phrase: 'CIRCUIT_ACCEPT_NEWENTRY', locale: langdest }, myuser.username, name) + '<br>' + struserinfomsg;
|
||||||
|
|
||||||
@@ -939,6 +943,7 @@ const MyTelegramBot = {
|
|||||||
groupid,
|
groupid,
|
||||||
}, */
|
}, */
|
||||||
]);
|
]);
|
||||||
|
send_notif = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -757,6 +757,7 @@ module.exports = {
|
|||||||
myreact: 1,
|
myreact: 1,
|
||||||
mycities: 1,
|
mycities: 1,
|
||||||
lang: 1,
|
lang: 1,
|
||||||
|
verified_by_aportador: 1,
|
||||||
'profile.img': 1,
|
'profile.img': 1,
|
||||||
'profile.mygroups': 1,
|
'profile.mygroups': 1,
|
||||||
'profile.mycircuits': 1,
|
'profile.mycircuits': 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user