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.
18 lines
514 B
JavaScript
18 lines
514 B
JavaScript
'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);
|
|
};
|
|
};
|