recent page gets alerts when new topics and posts are created

This commit is contained in:
Baris Soner Usakli
2013-06-27 21:11:04 -04:00
parent d0af1230b5
commit 761d8fc508
5 changed files with 110 additions and 4 deletions

View File

@@ -207,8 +207,7 @@ marked.setOptions({
user.getUserFields(uid, ['username','reputation','picture','signature'], function(data) {
var timestamp = Date.now();
io.sockets.in('topic_' + tid).emit('event:new_post', {
var socketData = {
'posts' : [
{
'pid' : pid,
@@ -226,7 +225,11 @@ marked.setOptions({
'editor': '',
}
]
});
};
io.sockets.in('topic_' + tid).emit('event:new_post', socketData);
io.sockets.in('recent_posts').emit('event:new_post', socketData);
});
} else {
socket.emit('event:alert', {