Settore se compariva "Tutti", veniva selezionato erroneamente di default -100
Risolto caricamento immagini Cliccando sull'immagine del profilo, nella Card, non si apre il Profilo Aggiunto "Estero" e "On Line" sul campo Comune. Orientamento dell'Immagine. viene storta una volta ridimensionata. Al momento della registrazione, dal BOT, in automatico viene presa l'immagine di Telegram e salvata sul proprio profilo della APP.
This commit is contained in:
@@ -25,6 +25,7 @@ const Subscription = mongoose.model('subscribers');
|
||||
|
||||
const server_constants = require('./server_constants');
|
||||
|
||||
const download = require('image-downloader');
|
||||
|
||||
// SETTINGS WebPush Configuration
|
||||
const webpush = require('web-push');
|
||||
@@ -880,7 +881,8 @@ module.exports = {
|
||||
let actions = [];
|
||||
if (cmd) {
|
||||
if (cmd === shared_consts.GROUPSCMD.REQGROUP) {
|
||||
descr = printf(this.get__('RICHIESTA_GRUPPO', lang), groupname, arradmins.username);
|
||||
descr = printf(this.get__('RICHIESTA_GRUPPO', lang), groupname,
|
||||
arradmins.username);
|
||||
openUrl = '/grp/' + groupname;
|
||||
tag = 'reqgroups';
|
||||
} else if (cmd === shared_consts.GROUPSCMD.BLOCK_USER) {
|
||||
@@ -1096,17 +1098,25 @@ module.exports = {
|
||||
return myapp.abilitanave;
|
||||
},
|
||||
|
||||
getdirByIdApp: function(idapp) {
|
||||
getdirByIdApp: function(idapp, dirmain = false) {
|
||||
|
||||
let mypath = '';
|
||||
const myapp =
|
||||
this.getApps().find(item => item.idapp === idapp);
|
||||
if (myapp) {
|
||||
if (process.env.NODE_ENV === 'test')
|
||||
return (myapp) ? myapp.dir_test : '';
|
||||
mypath = (myapp) ? myapp.dir_test : '';
|
||||
else
|
||||
return (myapp) ? myapp.dir : '';
|
||||
} else
|
||||
return '';
|
||||
mypath = (myapp) ? myapp.dir : '';
|
||||
|
||||
if (dirmain) {
|
||||
if (this.sulServer() !== 1) {
|
||||
mypath += '/public';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return mypath;
|
||||
},
|
||||
|
||||
getAdminEmailByIdApp: function(idapp) {
|
||||
@@ -1137,7 +1147,8 @@ module.exports = {
|
||||
},
|
||||
|
||||
getAskToVerifyReg: function(idapp) {
|
||||
return this.getConfSiteOptionEnabledByIdApp(idapp, shared_consts.ConfSite.Need_Aportador_On_DataReg_To_Verify_Reg);
|
||||
return this.getConfSiteOptionEnabledByIdApp(idapp,
|
||||
shared_consts.ConfSite.Need_Aportador_On_DataReg_To_Verify_Reg);
|
||||
},
|
||||
|
||||
isManagAndAdminDifferent(idapp) {
|
||||
@@ -1177,7 +1188,7 @@ module.exports = {
|
||||
return (myapp && myapp.telegram_support_chat)
|
||||
? myapp.telegram_support_chat
|
||||
: '';
|
||||
}catch (e) {
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
@@ -2118,7 +2129,7 @@ module.exports = {
|
||||
const stream = fs.createWriteStream(filename, {flags: 'a'});
|
||||
stream.write('\n' + mystr);
|
||||
stream.end();
|
||||
}catch (e) {
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -2180,7 +2191,10 @@ module.exports = {
|
||||
callback(err);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
console.log(' ... File Rinominato', oldPath, 'in:', newPath);
|
||||
}
|
||||
|
||||
callback();
|
||||
});
|
||||
|
||||
@@ -2192,6 +2206,7 @@ module.exports = {
|
||||
writeStream.on('error', callback);
|
||||
|
||||
readStream.on('close', function() {
|
||||
console.log('cancella file già copiato', oldPath);
|
||||
fs.unlink(oldPath, callback);
|
||||
});
|
||||
|
||||
@@ -2222,8 +2237,13 @@ module.exports = {
|
||||
try {
|
||||
let img_small = path.dirname(mypath) + '/' +
|
||||
server_constants.PREFIX_IMG_SMALL + path.basename(mypath);
|
||||
fs.unlink(img_small, () => {});
|
||||
console.log('delete file', mypath);
|
||||
fs.unlink(img_small, function(err) {
|
||||
if (err)
|
||||
console.log('Errore durante la Cancellazione del file', mypath);
|
||||
else
|
||||
console.log('deleted file', mypath);
|
||||
});
|
||||
|
||||
} catch (e) {
|
||||
console.error(err);
|
||||
}
|
||||
@@ -2574,7 +2594,7 @@ module.exports = {
|
||||
return process.env.LOCALE !== '1';
|
||||
},
|
||||
|
||||
refreshAllTablesInMem(idapp, table){
|
||||
refreshAllTablesInMem(idapp, table) {
|
||||
const telegrambot = require('../telegram/telegrambot');
|
||||
|
||||
if (table === shared_consts.TAB_MYBOTS) {
|
||||
@@ -2583,6 +2603,15 @@ module.exports = {
|
||||
telegrambot.reloadSites();
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
downloadImage(url, filepath) {
|
||||
|
||||
return download.image({
|
||||
url,
|
||||
dest: filepath
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user