Impostato la lingua fissa a ITALIANO: ancora non ci sono le traduzioni e poi qualcosa sul server fa casino (non arrivano le richieste...)

Risolto Bug sui messaggi di registrazione, se l'utente non aveva l'Username Telegram
This commit is contained in:
paoloar77
2022-03-08 01:01:20 +01:00
parent 466fdd597d
commit 82e3ed7175
11 changed files with 209 additions and 96 deletions

View File

@@ -816,7 +816,7 @@ module.exports = {
});
});
}).catch(error => {
console.log('ERROR: sendNotificationToUser', error);
console.log('ERROR: sendNotificationToUser', error.data.body ? error.data.body : error);
});
});
// q.allSettled(parallelSubscriptionCalls).then((pushResults) => {
@@ -941,7 +941,7 @@ module.exports = {
objmsg.tag = 'reqgroups';
sendnotif = false; // non lo rimandare 2 volte !
telegrambot.askConfirmationUser(idapp, shared_consts.CallFunz.RICHIESTA_GRUPPO, myuser, singleadmin.username, {groupid: group._id, groupname });
telegrambot.askConfirmationUser(idapp, shared_consts.CallFunz.RICHIESTA_GRUPPO, myuser, singleadmin.username, groupname, group._id);
} else if (cmd === shared_consts.GROUPSCMD.BLOCK_USER) {
objmsg.descr = printf(this.get__('RICHIESTA_BLOCCO_GRUPPO', lang),
@@ -1403,19 +1403,27 @@ module.exports = {
});
if (params.filterand.includes(shared_consts.FILTER_USER_NO_TELEGRAM_ID))
filtriadded.push({'profile.teleg_id': {$lt: 1}});
if (params.filterand.includes(shared_consts.FILTER_USER_SI_TELEGRAM_ID))
filtriadded.push({'profile.teleg_id': {$gt: 1}});
if (params.filterand.includes(
shared_consts.FILTER_USER_CODICE_AUTH_TELEGRAM))
filtriadded.push({'profile.teleg_checkcode': {$gt: 1}});
if (params.filterand.includes(
shared_consts.FILTER_USER_NO_EMAIL_VERIFICATA))
filtriadded.push({verified_email: false});
if (params.filterand.includes(
shared_consts.FILTER_USER_NO_VERIFIED_APORTADOR))
if (params.filterand.includes(shared_consts.FILTER_USER_NO_VERIFIED_APORTADOR))
filtriadded.push({
$or: [
{verified_by_aportador: {$exists: false}},
{verified_by_aportador: {$exists: true, $eq: false}}],
});
if (params.filterand.includes(shared_consts.FILTER_USER_WITHOUT_USERNAME_TELEGRAM))
filtriadded.push({
$or: [
{'profile.username_telegram': {$exists: false}},
{'profile.username_telegram': {$exists: true, $eq: ''}}],
});
if (params.filterand.includes(shared_consts.FILTER_USER_NO_DREAM))
filtriadded.push({
@@ -2756,5 +2764,9 @@ module.exports = {
return msg;
},
getlinkRequestNewPassword: function (idapp, email, tokenforgot) {
const strlinkreg = this.getHostByIdApp(idapp) + process.env.LINK_UPDATE_PASSWORD + `?idapp=${idapp}&email=${email}&tokenforgot=${tokenforgot}`;
return strlinkreg;
},
};

View File

@@ -254,10 +254,12 @@ module.exports = {
const mytitle = tools.convertSpecialTags(user, params.title);
const mycontent = tools.convertSpecialTags(user, params.content);
let risult = null;
if (params.sendreally) {
if (tools.isBitActive(params.typesend,
shared_consts.TypeSend.PUSH_NOTIFICATION)) {
tools.sendNotificationToUser(user._id, mytitle, mycontent, params.openUrl, params.openUrl2, params.tag,
risult = tools.sendNotificationToUser(user._id, mytitle, mycontent, params.openUrl, params.openUrl2, params.tag,
params.actions).
then(ris => {
@@ -270,18 +272,27 @@ module.exports = {
const telegid = user.profile.teleg_id;
if (telegid > 0) {
telegrambot.local_sendMsgTelegramByIdTelegram(idapp, telegid, mycontent);
risult = await telegrambot.local_sendMsgTelegramByIdTelegram(idapp, telegid, mycontent);
await tools.snooze(100);
}
}
}
numrec++;
if (params.sendreally) {
if (params.sendreally && risult) {
nummsgsent++;
}
if ((nummsgsent % 100) === 0) {
console.log('Inviati ', nummsgsent, 'messaggi...')
}
}
}
if (nummsgsent > 0) {
console.log('FINE Invio Messaggi ! Inviati Totali: ', nummsgsent, 'su', numrec);
}
return {
numrec,
nummsgsent,

View File

@@ -31,6 +31,8 @@ module.exports = {
FILTER_TO_MAKE_MEMBERSHIP_CARD: 524288,
FILTER_MEMBERSHIP_CARD_OK: 1048576,
FILTER_USER_NO_VERIFIED_APORTADOR: 2097152,
FILTER_USER_SI_TELEGRAM_ID: 4194304,
FILTER_USER_WITHOUT_USERNAME_TELEGRAM: 8388608,
OPTIONS_SEARCH_ONLY_FULL_WORDS: 1,
OPTIONS_SEARCH_USER_ONLY_FULL_WORDS: 2,