mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-04 19:41:16 +01:00
closes #220
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
isFollowing = templates.get('isFollowing');
|
||||
|
||||
$(document).ready(function() {
|
||||
var username = $('.account-username a').html();
|
||||
app.enter_room('users/' + theirid);
|
||||
|
||||
app.addCommasToNumbers();
|
||||
|
||||
@@ -25,7 +27,6 @@
|
||||
|
||||
followBtn.on('click', function() {
|
||||
socket.emit('api:user.follow', {uid: theirid}, function(success) {
|
||||
var username = $('.account-username a').html();
|
||||
if(success) {
|
||||
followBtn.hide();
|
||||
unfollowBtn.show();
|
||||
@@ -39,7 +40,6 @@
|
||||
|
||||
unfollowBtn.on('click', function() {
|
||||
socket.emit('api:user.unfollow', {uid: theirid}, function(success) {
|
||||
var username = $('.account-username a').html();
|
||||
if(success) {
|
||||
followBtn.show();
|
||||
unfollowBtn.hide();
|
||||
@@ -71,6 +71,11 @@
|
||||
|
||||
socket.emit('api:user.isOnline', theirid, handleUserOnline);
|
||||
|
||||
socket.on('event:new_post', function(data) {
|
||||
var html = templates.prepare(templates['account'].blocks['posts']).parse(data);
|
||||
$('.user-recent-posts').prepend(html);
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
}());
|
||||
@@ -259,6 +259,7 @@ var RDB = require('./redis.js'),
|
||||
var socketData = { posts: [postData] };
|
||||
io.sockets.in('topic_' + tid).emit('event:new_post', socketData);
|
||||
io.sockets.in('recent_posts').emit('event:new_post', socketData);
|
||||
io.sockets.in('users/' + uid).emit('event:new_post', socketData);
|
||||
});
|
||||
|
||||
callback(null, 'Reply successful');
|
||||
|
||||
Reference in New Issue
Block a user