piccole modifiche...
This commit is contained in:
@@ -2653,10 +2653,10 @@ UserSchema.statics.setFriendsCmd = async function (req, idapp, usernameOrig, use
|
||||
shared_consts.TypeNotifs.TYPEDIR_FRIENDS,
|
||||
shared_consts.TypeNotifs.ID_FRIENDS_REPORTED);
|
||||
|
||||
if (usernameOrig !== telegrambot.ADMIN_USER_SERVER) {
|
||||
if (usernameOrig !== shared_consts.ADMIN_USER_SERVER) {
|
||||
// Send a notification to the Admin
|
||||
await SendNotif.createNewNotifToSingleUser(req, null,
|
||||
{ username_worked, usernameDest: telegrambot.ADMIN_USER_SERVER, username_action, isAdmin: true }, false,
|
||||
{ username_worked, usernameDest: shared_consts.ADMIN_USER_SERVER, username_action, isAdmin: true }, false,
|
||||
shared_consts.TypeNotifs.TYPEDIR_FRIENDS,
|
||||
shared_consts.TypeNotifs.ID_FRIENDS_REPORTED);
|
||||
}
|
||||
@@ -2685,10 +2685,10 @@ UserSchema.statics.setFriendsCmd = async function (req, idapp, usernameOrig, use
|
||||
shared_consts.TypeNotifs.TYPEDIR_FRIENDS,
|
||||
shared_consts.TypeNotifs.ID_FRIENDS_UNBLOCKED);
|
||||
|
||||
if (usernameOrig !== telegrambot.ADMIN_USER_SERVER) {
|
||||
if (usernameOrig !== shared_consts.ADMIN_USER_SERVER) {
|
||||
// Send a notification to the Admin
|
||||
await SendNotif.createNewNotifToSingleUser(req, null,
|
||||
{ username_worked, usernameDest: telegrambot.ADMIN_USER_SERVER, username_action, isAdmin: true }, false,
|
||||
{ username_worked, usernameDest: shared_consts.ADMIN_USER_SERVER, username_action, isAdmin: true }, false,
|
||||
shared_consts.TypeNotifs.TYPEDIR_FRIENDS,
|
||||
shared_consts.TypeNotifs.ID_FRIENDS_UNBLOCKED);
|
||||
}
|
||||
@@ -4085,22 +4085,6 @@ UserSchema.statics.isManagerByIdTeleg = async function (idapp, idtelegram) {
|
||||
});
|
||||
};
|
||||
|
||||
UserSchema.statics.isAdminByIdTeleg = async function (idapp, idtelegram) {
|
||||
const User = this;
|
||||
|
||||
return await User.findOne({
|
||||
idapp,
|
||||
username: 'paoloar77',
|
||||
'profile.admin_telegram': true,
|
||||
'profile.teleg_id': idtelegram,
|
||||
}, { 'profile.teleg_id': 1 }).then((rec) => {
|
||||
return (!!rec && rec.profile.teleg_id === idtelegram);
|
||||
}).catch((e) => {
|
||||
console.error('getusersManagers', e);
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
UserSchema.statics.isAdminByUsername = async function (idapp, username) {
|
||||
const User = this;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user