|
|
@ -3,17 +3,11 @@ var categories = require('../categories'),
|
|
|
|
SocketCategories = {};
|
|
|
|
SocketCategories = {};
|
|
|
|
|
|
|
|
|
|
|
|
SocketCategories.getRecentReplies = function(socket, tid, callback) {
|
|
|
|
SocketCategories.getRecentReplies = function(socket, tid, callback) {
|
|
|
|
categories.getRecentReplies(tid, socket.uid, 4, function(err, replies) {
|
|
|
|
categories.getRecentReplies(tid, socket.uid, 4, callback);
|
|
|
|
callback(replies);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
SocketCategories.get = function(socket, data, callback) {
|
|
|
|
SocketCategories.get = function(socket, data, callback) {
|
|
|
|
categories.getAllCategories(0, function(err, categories) {
|
|
|
|
categories.getAllCategories(0, callback);
|
|
|
|
if(callback) {
|
|
|
|
|
|
|
|
callback(categories);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
SocketCategories.loadMore = function(socket, data, callback) {
|
|
|
|
SocketCategories.loadMore = function(socket, data, callback) {
|
|
|
@ -21,7 +15,7 @@ SocketCategories.loadMore = function(socket, data, callback) {
|
|
|
|
end = start + 9;
|
|
|
|
end = start + 9;
|
|
|
|
|
|
|
|
|
|
|
|
categories.getCategoryTopics(data.cid, start, end, socket.uid, function(topics) {
|
|
|
|
categories.getCategoryTopics(data.cid, start, end, socket.uid, function(topics) {
|
|
|
|
callback({
|
|
|
|
callback(null, {
|
|
|
|
topics: topics
|
|
|
|
topics: topics
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|