|
|
@ -2,13 +2,13 @@ var categories = require('../categories'),
|
|
|
|
|
|
|
|
|
|
|
|
SocketCategories = {};
|
|
|
|
SocketCategories = {};
|
|
|
|
|
|
|
|
|
|
|
|
SocketCategories.getRecentReplies = function(tid, callback, sessionData) {
|
|
|
|
SocketCategories.getRecentReplies = function(socket, tid, callback) {
|
|
|
|
categories.getRecentReplies(tid, sessionData.uid, 4, function(err, replies) {
|
|
|
|
categories.getRecentReplies(tid, socket.uid, 4, function(err, replies) {
|
|
|
|
callback(replies);
|
|
|
|
callback(replies);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
SocketCategories.get = function(callback) {
|
|
|
|
SocketCategories.get = function(socket, data, callback) {
|
|
|
|
categories.getAllCategories(0, function(err, categories) {
|
|
|
|
categories.getAllCategories(0, function(err, categories) {
|
|
|
|
if(callback) {
|
|
|
|
if(callback) {
|
|
|
|
callback(categories);
|
|
|
|
callback(categories);
|
|
|
@ -16,11 +16,11 @@ SocketCategories.get = function(callback) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
SocketCategories.loadMore = function(data, callback, sessionData) {
|
|
|
|
SocketCategories.loadMore = function(socket, data, callback) {
|
|
|
|
var start = data.after,
|
|
|
|
var start = data.after,
|
|
|
|
end = start + 9;
|
|
|
|
end = start + 9;
|
|
|
|
|
|
|
|
|
|
|
|
categories.getCategoryTopics(data.cid, start, end, sessionData.uid, function(topics) {
|
|
|
|
categories.getCategoryTopics(data.cid, start, end, socket.uid, function(topics) {
|
|
|
|
callback({
|
|
|
|
callback({
|
|
|
|
topics: topics
|
|
|
|
topics: topics
|
|
|
|
});
|
|
|
|
});
|
|
|
|