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

19 lines
511 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) {
db.getSortedSetRevRange('uid:' + uid + ':ignored_tids', start, stop, callback);
};
User.addTopicIdToUser = function(uid, tid, timestamp, callback) {
async.parallel([
async.apply(db.sortedSetAdd, 'uid:' + uid + ':topics', timestamp, tid),
async.apply(User.incrementUserFieldBy, uid, 'topiccount', 1)
], callback);
};
};