This commit is contained in:
Surya Paolo
2024-04-26 00:49:05 +02:00
parent 7773c2a87b
commit 2cdb83cddf
2 changed files with 14 additions and 4 deletions

View File

@@ -1719,7 +1719,17 @@ UserSchema.statics.SvuotaTuttiGliAccessiOnlineConToken = async function (idapp)
const User = this;
return await User.updateMany({ idapp },
{ $pull: { tokens: { refreshToken: { $exists: false } } } });
{
$pull: {
tokens:
{
$or: [{ refreshToken: { $exists: false } },
{ refreshToken: { $exists: true, $eq: '' } }
]
},
}
});
};
@@ -2484,7 +2494,7 @@ UserSchema.statics.setFriendsCmd = async function (req, idapp, usernameOrig, use
if (!disablenotif) {
const userDest = await User.getRecLangAndIdByUsername(idapp, usernameDest);
const user = await User.getRecLangAndIdByUsername(idapp, usernameOrig);
let msgDest = i18n.__({ phrase: 'HANDSHAKE_SENT_FROM_YOU', locale: userDest.lang }, usernameDest);
if (already_stretta)
msgDest = i18n.__({ phrase: 'HANDSHAKE_CONFIRMED', locale: userDest.lang }, usernameDest);