This commit is contained in:
barisusakli
2014-06-23 17:26:02 -04:00
parent a9adfe9428
commit 9af12819e3
4 changed files with 32 additions and 28 deletions

View File

@@ -395,6 +395,12 @@ var async = require('async'),
});
};
Topics.isOwner = function(tid, uid, callback) {
Topics.getTopicField(tid, 'uid', function(err, author) {
callback(err, parseInt(author, 10) === parseInt(uid, 10));
});
};
Topics.updateTimestamp = function(tid, timestamp) {
db.sortedSetAdd('topics:recent', timestamp, tid);
Topics.setTopicField(tid, 'lastposttime', timestamp);