Click per mandare un messaggio al Destinatario dei RIS, se non è entrato ancora in RIS ITALIA.

This commit is contained in:
Surya Paolo
2023-11-19 23:40:38 +01:00
parent 045057082c
commit d434374ed9
8 changed files with 205 additions and 6 deletions

View File

@@ -777,6 +777,29 @@ router.post('/friends/cmd', authenticate, async (req, res) => {
});
router.post('/sendcmd', authenticate, async (req, res) => {
const usernameLogged = req.user.username;
const idapp = req.body.idapp;
const locale = req.body.locale;
let usernameOrig = req.body.usernameOrig;
let usernameDest = req.body.usernameDest;
const cmd = req.body.cmd;
const value = req.body.value;
usernameOrig = await User.getRealUsernameByUsername(idapp, usernameOrig);
usernameDest = await User.getRealUsernameByUsername(idapp, usernameDest);
return User.sendCmd(req, idapp, usernameOrig, usernameDest, cmd, value).
then((ris) => {
res.send(ris);
}).
catch((e) => {
tools.mylog('ERRORE IN sendcmd: ' + e.message);
res.status(400).send();
});
});
router.post('/groups/cmd', authenticate, (req, res) => {
const usernameLogged = req.user.username;
const idapp = req.body.idapp;
@@ -1521,6 +1544,9 @@ async function eseguiDbOpUser(idapp, mydata, locale, req, res) {
} else if (mydata.dbop === 'noCircuit') {
await User.findOneAndUpdate({ _id: mydata._id },
{ $set: { 'profile.noCircuit': mydata.value } });
} else if (mydata.dbop === 'noCircIta') {
await User.findOneAndUpdate({ _id: mydata._id },
{ $set: { 'profile.noCircIta': mydata.value } });
} else if (mydata.dbop === 'noFoto') {
await User.findOneAndUpdate({ _id: mydata._id },
{ $set: { 'profile.noFoto': mydata.value } });