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",
|
||||
"program": "${workspaceFolder}/node_modules/nodemon/bin/nodemon.js",
|
||||
"restart": true,
|
||||
"runtimeExecutable": "/Users/paolo/.nvm/versions/node/v16.19.0/bin/node",
|
||||
"runtimeExecutable": "node",
|
||||
"runtimeArgs": [
|
||||
"--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_TO_ME": "❌ Sei uscito dal '%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",
|
||||
"COLLETTIVO": "Gruppo",
|
||||
"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",
|
||||
"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>.",
|
||||
"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));
|
||||
}
|
||||
|
||||
|
||||
if (myrecnotifpass.tablerec === shared_consts.TABLES_MYGOODS) {
|
||||
idSector = myrectableorig.idSectorGood;
|
||||
} else {
|
||||
|
||||
@@ -4,6 +4,7 @@ const validator = require('validator');
|
||||
const jwt = require('jsonwebtoken');
|
||||
const _ = require('lodash');
|
||||
|
||||
const printf = require('util').format;
|
||||
const tools = require('../tools/general');
|
||||
|
||||
const { Settings } = require('../models/settings');
|
||||
@@ -2057,10 +2058,20 @@ UserSchema.statics.setFriendsCmd = async function (req, idapp, usernameOrig, use
|
||||
req = tools.getReqByPar(idapp, usernameOrig);
|
||||
}
|
||||
|
||||
let userDest = null;
|
||||
if (usernameDest)
|
||||
userDest = await User.getUserShortDataByUsername(idapp, usernameDest);
|
||||
|
||||
const username_action = req.user.username;
|
||||
let username_worked = usernameDest;
|
||||
|
||||
let ris = null;
|
||||
let lang = '';
|
||||
let user = null;
|
||||
if (usernameOrig) {
|
||||
user = await User.getUserShortDataByUsername(idapp, usernameOrig);
|
||||
}
|
||||
lang = user ? user.lang : '';
|
||||
let update = {};
|
||||
try {
|
||||
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,
|
||||
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() } },
|
||||
{ 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) {
|
||||
// Aggiungo l'Amicizia a me
|
||||
const foundIfAlreadyFriend = await User.findOne({
|
||||
@@ -2378,7 +2402,7 @@ UserSchema.statics.sendCmd = async function (req, idapp, usernameOrig, usernameD
|
||||
let title = tools.getNomeAppByIdApp(idapp);
|
||||
let keyb = null;
|
||||
let descr = '';
|
||||
|
||||
|
||||
let send_notif = false;
|
||||
let send_msgTelegramBot = false;
|
||||
let actions = [];
|
||||
@@ -2395,7 +2419,7 @@ UserSchema.statics.sendCmd = async function (req, idapp, usernameOrig, usernameD
|
||||
openUrl = '/circuit/ris_italia';
|
||||
bottone = i18n.__({ phrase: 'CIRCUIT_OPEN_RISITALIA', locale: langdest });
|
||||
tag = 'risitalia';
|
||||
|
||||
|
||||
send_notif = true;
|
||||
send_msgTelegramBot = true;
|
||||
|
||||
@@ -2418,15 +2442,15 @@ UserSchema.statics.sendCmd = async function (req, idapp, usernameOrig, usernameD
|
||||
}
|
||||
|
||||
// Invia Msg
|
||||
if (send_msgTelegramBot && msgtelegram) {
|
||||
if (send_msgTelegramBot && msgtelegram) {
|
||||
await telegrambot.local_sendMsgTelegramByIdTelegram(idapp, telegid, msgtelegram, undefined, undefined, true, keyb);
|
||||
}
|
||||
|
||||
const userprofile = await User.getInfoFriendByUsername(idapp, usernameDest);
|
||||
const myuser = await User.getInfoFriendByUsername(idapp, usernameOrig);
|
||||
|
||||
|
||||
ris = { userprofile, myuser, popupOnApp, result: true };
|
||||
|
||||
|
||||
} catch (e) {
|
||||
popupOnApp = e;
|
||||
ris = { popupOnApp };
|
||||
@@ -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) {
|
||||
|
||||
if (!username) {
|
||||
@@ -4076,7 +4114,7 @@ UserSchema.statics.getUsersDreams = async function (idapp) {
|
||||
UserSchema.statics.getLastUsers = async function (idapp) {
|
||||
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(
|
||||
{
|
||||
@@ -4090,6 +4128,7 @@ UserSchema.statics.getLastUsers = async function (idapp) {
|
||||
name: 1,
|
||||
surname: 1,
|
||||
lasttimeonline: 1,
|
||||
verified_by_aportador: 1,
|
||||
'profile.img': 1,
|
||||
date_reg: 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.userstoverify = await User.getUsersToVerify(idapp, recUser.username);
|
||||
|
||||
recUser.profile.manage_mygroups = listManageGroups
|
||||
? listManageGroups
|
||||
: [];
|
||||
|
||||
@@ -893,6 +893,8 @@ const MyTelegramBot = {
|
||||
}, */
|
||||
]);
|
||||
}
|
||||
send_notif = true;
|
||||
|
||||
} else if (myfunc === shared_consts.CallFunz.RICHIESTA_GRUPPO) {
|
||||
|
||||
domanda = printf(getstr(langdest, 'MSG_ACCEPT_NEWENTRY_INGROUP'), name) + '<br>' + struserinfomsg;
|
||||
@@ -924,6 +926,8 @@ const MyTelegramBot = {
|
||||
groupid + tools.SEP + groupname,
|
||||
},*/
|
||||
]);
|
||||
send_notif = true;
|
||||
|
||||
} else {
|
||||
domanda = i18n.__({ phrase: 'CIRCUIT_ACCEPT_NEWENTRY', locale: langdest }, myuser.username, name) + '<br>' + struserinfomsg;
|
||||
|
||||
@@ -939,6 +943,7 @@ const MyTelegramBot = {
|
||||
groupid,
|
||||
}, */
|
||||
]);
|
||||
send_notif = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -757,6 +757,7 @@ module.exports = {
|
||||
myreact: 1,
|
||||
mycities: 1,
|
||||
lang: 1,
|
||||
verified_by_aportador: 1,
|
||||
'profile.img': 1,
|
||||
'profile.mygroups': 1,
|
||||
'profile.mycircuits': 1,
|
||||
|
||||
Reference in New Issue
Block a user