You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
438 B
JavaScript
17 lines
438 B
JavaScript
'use strict';
|
|
|
|
const db = require('../database');
|
|
|
|
module.exports = function (User) {
|
|
User.getIgnoredTids = async function (uid, start, stop) {
|
|
return await db.getSortedSetRevRange(`uid:${uid}:ignored_tids`, start, stop);
|
|
};
|
|
|
|
User.addTopicIdToUser = async function (uid, tid, timestamp) {
|
|
await Promise.all([
|
|
db.sortedSetAdd(`uid:${uid}:topics`, timestamp, tid),
|
|
User.incrementUserFieldBy(uid, 'topiccount', 1),
|
|
]);
|
|
};
|
|
};
|