mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-22 07:23:01 +01:00
fix: dont lower bookmark
also ignore guests/spiders
This commit is contained in:
@@ -22,7 +22,13 @@ module.exports = function (Topics) {
|
||||
};
|
||||
|
||||
Topics.setUserBookmark = async function (tid, uid, index) {
|
||||
await db.sortedSetAdd(`tid:${tid}:bookmarks`, index, uid);
|
||||
if (parseInt(uid, 10) <= 0) {
|
||||
return;
|
||||
}
|
||||
const currentIndex = await db.sortedSetScore(`tid:${tid}:bookmarks`, uid);
|
||||
if (!currentIndex || index > currentIndex) {
|
||||
await db.sortedSetAdd(`tid:${tid}:bookmarks`, index, uid);
|
||||
}
|
||||
};
|
||||
|
||||
Topics.getTopicBookmarks = async function (tid) {
|
||||
|
||||
Reference in New Issue
Block a user