properly filter /unread /recent /popular /top (#7927)

* feat: add failing test for pagination

* feat: test

* fix: redis tests

* refactor: remove logs

* fix: add new test

* feat: make sortedSetRangeByScore work with keys on redis

* fix: hardcoded set name

* feat: show topics from readable categories on recent/popular/top

* feat: rewrite unread topics

respect watched categories and followed topics

* fix: term + watched
This commit is contained in:
Barış Soner Uşaklı
2019-09-26 21:55:49 -04:00
committed by GitHub
parent 17437897f9
commit 310c6fd33f
12 changed files with 171 additions and 193 deletions

View File

@@ -213,7 +213,7 @@ helpers.getCategories = async function (set, uid, privilege, selectedCid) {
helpers.getCategoriesByStates = async function (uid, selectedCid, states) {
let cids = await user.getCategoriesByStates(uid, states);
cids = await privileges.categories.filterCids('read', cids, uid);
cids = await privileges.categories.filterCids('topics:read', cids, uid);
return await getCategoryData(cids, uid, selectedCid);
};