Merge branch 'master' into develop

isekai-main
Barış Soner Uşaklı 2 years ago
commit 5edeb79f14

@ -181,7 +181,6 @@ module.exports = function (utils, Benchpress, relative_path) {
} }
function renderTopicEvents(index, sort) { function renderTopicEvents(index, sort) {
console.warn('[renderTopicEvents] deprecated, use a partial at partials/topic/event.tpl');
if (sort === 'most_votes') { if (sort === 'most_votes') {
return ''; return '';
} }

@ -109,8 +109,13 @@ privsAdmin.resolve = (path) => {
return privsAdmin.routeMap[path]; return privsAdmin.routeMap[path];
} }
const found = Object.entries(privsAdmin.routePrefixMap).find(entry => path.startsWith(entry[0])); const found = Object.entries(privsAdmin.routePrefixMap)
return found ? found[1] : undefined; .filter(entry => path.startsWith(entry[0]))
.sort((entry1, entry2) => entry2[0].length - entry1[0].length);
if (!found.length) {
return undefined;
}
return found[0][1]; // [0] is path [1] is privilege
}; };
privsAdmin.list = async function (uid) { privsAdmin.list = async function (uid) {

@ -13,7 +13,7 @@ const logger = require('../logger');
const plugins = require('../plugins'); const plugins = require('../plugins');
const ratelimit = require('../middleware/ratelimit'); const ratelimit = require('../middleware/ratelimit');
const Namespaces = {}; const Namespaces = Object.create(null);
const Sockets = module.exports; const Sockets = module.exports;

Loading…
Cancel
Save