room quota

This commit is contained in:
wolfy01 2020-04-07 02:42:49 -04:00 committed by GitHub
parent 033f8d3c2a
commit fde1745f82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -23,6 +23,7 @@ module.exports = (cl) => {
}]) }])
}) })
cl.on("ch", msg => { cl.on("ch", msg => {
if (!cl.quotas.room.attempt()) return;
if (!msg.hasOwnProperty("set") || !msg.set) msg.set = {}; if (!msg.hasOwnProperty("set") || !msg.set) msg.set = {};
if (msg.hasOwnProperty("_id") && typeof msg._id == "string") { if (msg.hasOwnProperty("_id") && typeof msg._id == "string") {
if (msg._id.length > 512) return; if (msg._id.length > 512) return;