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.
nodebb/src/user/topics.js

18 lines
514 B
JavaScript

9 years ago
'use strict';
var async = require('async');
var db = require('../database');
module.exports = function (User) {
User.getIgnoredTids = function (uid, start, stop, callback) {
9 years ago
db.getSortedSetRevRange('uid:' + uid + ':ignored_tids', start, stop, callback);
};
User.addTopicIdToUser = function (uid, tid, timestamp, callback) {
9 years ago
async.parallel([
async.apply(db.sortedSetAdd, 'uid:' + uid + ':topics', timestamp, tid),
async.apply(User.incrementUserFieldBy, uid, 'topiccount', 1),
9 years ago
], callback);
};
8 years ago
};