adapt chat routes to groups saved on user model

This commit is contained in:
Matteo Pagliazzi
2015-12-18 16:29:57 +01:00
parent ddf77e0e35
commit e53bd5079a
4 changed files with 17 additions and 11 deletions

View File

@@ -232,6 +232,7 @@ export default function cron (options = {}) {
progress.collect = _.transform(progress.collect, (m, v, k) => m[k] = 0);
// Clean PMs - keep 200 for subscribers and 50 for free users
// TODO tests
let maxPMs = user.isSubscribed() ? 200 : 50; // TODO 200 limit for contributors too
let numberOfPMs = Object.keys(user.inbox.messages).length;
if (Object.keys(user.inbox.messages).length > maxPMs) {