- L'utente entra direttamente sul circuito, con fido a zero.
++Abilitazione Fido utente (per admin).
This commit is contained in:
@@ -450,8 +450,6 @@ const Status = {
|
||||
|
||||
const Cmd = {
|
||||
VALIDATE_REGISTRATION: 1,
|
||||
RICHIESTA_GRUPPO: 2,
|
||||
RICHIESTA_CIRCUIT: 3,
|
||||
};
|
||||
|
||||
const Destin = {
|
||||
@@ -891,37 +889,37 @@ const MyTelegramBot = {
|
||||
callback_data: InlineConferma.RISPOSTA_NO + myfunc + tools.SEP + myuser.username + tools.SEP + '' + tools.SEP + groupid,
|
||||
},
|
||||
]);
|
||||
} else if (myfunc === shared_consts.CallFunz.RICHIESTA_CIRCUIT) {
|
||||
} else if (myfunc === shared_consts.CallFunz.RICHIESTA_FIDO) {
|
||||
|
||||
if (groupname) {
|
||||
domanda = i18n.__({ phrase: 'CIRCUIT_ACCEPT_NEWENTRY_BYGROUP', locale: langdest }, groupname) + '<br>' + struserinfomsg;
|
||||
|
||||
keyb = cl.getInlineKeyboard(myuser.lang, [
|
||||
{
|
||||
text: '✅ Accetta ' + groupname,
|
||||
text: '✅ Abilita fido a ' + groupname,
|
||||
callback_data: InlineConferma.RISPOSTA_SI + myfunc + tools.SEP + myuser.username + tools.SEP + '' + tools.SEP + '' + tools.SEP +
|
||||
groupid + tools.SEP + groupname,
|
||||
},
|
||||
{
|
||||
/*{
|
||||
text: '🚫 Rifiuta ' + groupname,
|
||||
callback_data: InlineConferma.RISPOSTA_NO + myfunc + tools.SEP + myuser.username + tools.SEP + '' + tools.SEP + '' + tools.SEP +
|
||||
groupid + tools.SEP + groupname,
|
||||
},
|
||||
},*/
|
||||
]);
|
||||
} else {
|
||||
domanda = i18n.__({ phrase: 'CIRCUIT_ACCEPT_NEWENTRY', locale: langdest }, name) + '<br>' + struserinfomsg;
|
||||
domanda = i18n.__({ phrase: 'CIRCUIT_ACCEPT_NEWENTRY', locale: langdest }, myuser.username, name) + '<br>' + struserinfomsg;
|
||||
|
||||
keyb = cl.getInlineKeyboard(myuser.lang, [
|
||||
{
|
||||
text: '✅ Accetta ' + myuser.username,
|
||||
text: '✅ Abilita fido a ' + myuser.username,
|
||||
callback_data: InlineConferma.RISPOSTA_SI + myfunc + tools.SEP + myuser.username + tools.SEP + '' + tools.SEP + '' + tools.SEP +
|
||||
groupid,
|
||||
},
|
||||
{
|
||||
/*{
|
||||
text: '🚫 Rifiuta ' + myuser.username,
|
||||
callback_data: InlineConferma.RISPOSTA_NO + myfunc + tools.SEP + myuser.username + tools.SEP + '' + tools.SEP + '' + tools.SEP +
|
||||
groupid,
|
||||
},
|
||||
}, */
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -2809,8 +2807,6 @@ class Telegram {
|
||||
async setCmdToUsername(rec, username, cmd_to_set, valuebool) {
|
||||
if (cmd_to_set === Cmd.VALIDATE_REGISTRATION) {
|
||||
return await User.setVerifiedByAportador(rec.user.idapp, username, valuebool);
|
||||
} else if (cmd_to_set === Cmd.RICHIESTA_GRUPPO) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4083,20 +4079,14 @@ if (true) {
|
||||
}
|
||||
|
||||
}
|
||||
} else if (data.action === InlineConferma.RISPOSTA_SI + shared_consts.CallFunz.RICHIESTA_CIRCUIT) {
|
||||
} else if (data.action === InlineConferma.RISPOSTA_SI + shared_consts.CallFunz.RICHIESTA_FIDO) {
|
||||
|
||||
if (circuit) {
|
||||
cmd = shared_consts.CIRCUITCMD.SET;
|
||||
let foundIfAlreadyCircuit = false;
|
||||
if (data.groupname) {
|
||||
foundIfAlreadyCircuit = await MyGroup.ifCircuitAlreadyInGroup(user.idapp, data.groupname, circuit.name);
|
||||
} else {
|
||||
foundIfAlreadyCircuit = await User.ifAlreadyInCircuit(user.idapp, data.username, circuit.name);
|
||||
}
|
||||
if (!foundIfAlreadyCircuit) {
|
||||
// Aggiungilo nel Circuito
|
||||
await User.setCircuitCmd(user.idapp, data.username, circuit.name, cmd, 0, username_action, { groupname: data.groupname });
|
||||
}
|
||||
cmd = shared_consts.CIRCUITCMD.SETFIDO;
|
||||
// Aggiungilo nel Circuito
|
||||
// await User.setCircuitCmd(user.idapp, data.username, circuit.name, cmd, 0, username_action, { groupname: data.groupname });
|
||||
// Abiglitagli il Fido
|
||||
await User.setCircuitCmd(user.idapp, data.username, circuit.name, cmd, 0, username_action, { groupname: data.groupname });
|
||||
}
|
||||
} else if (data.action === InlineConferma.RISPOSTA_NO + shared_consts.CallFunz.RICHIESTA_CIRCUIT) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user