mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
changes for live streaming of posts
This commit is contained in:
@@ -71,10 +71,7 @@ SocketPosts.reply = function(socket, data, callback) {
|
||||
posts: [postData]
|
||||
};
|
||||
|
||||
var rooms = ['recent_posts', 'home', 'topic_' + postData.tid, 'user/' + postData.uid];
|
||||
rooms.forEach(function(room) {
|
||||
index.server.sockets.in(room).emit('event:new_post', socketData);
|
||||
});
|
||||
index.server.sockets.emit('event:new_post', socketData);
|
||||
|
||||
callback();
|
||||
}
|
||||
@@ -326,4 +323,9 @@ SocketPosts.loadMoreUserPosts = function(socket, data, callback) {
|
||||
posts.getPostsByUid(socket.uid, data.uid, start, end, callback);
|
||||
};
|
||||
|
||||
SocketPosts.getRecentPosts = function(socket, term, callback) {
|
||||
posts.getRecentPosts(socket.uid, 0, 19, term, callback);
|
||||
};
|
||||
|
||||
|
||||
module.exports = SocketPosts;
|
||||
Reference in New Issue
Block a user