|
|
@ -214,35 +214,28 @@ marked.setOptions({
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
user.getUserFields(uid, ['username','reputation','picture','signature'], function(data) {
|
|
|
|
var timestamp = Date.now();
|
|
|
|
|
|
|
|
var socketData = {
|
|
|
|
var timestamp = Date.now();
|
|
|
|
'posts' : [
|
|
|
|
var socketData = {
|
|
|
|
{
|
|
|
|
'posts' : [
|
|
|
|
'pid' : pid,
|
|
|
|
{
|
|
|
|
'content' : marked(content || ''),
|
|
|
|
'pid' : pid,
|
|
|
|
'uid' : uid,
|
|
|
|
'content' : marked(content || ''),
|
|
|
|
'post_rep' : 0,
|
|
|
|
'uid' : uid,
|
|
|
|
'timestamp' : timestamp,
|
|
|
|
'username' : data.username || 'anonymous',
|
|
|
|
'relativeTime': utils.relativeTime(timestamp),
|
|
|
|
'user_rep' : data.reputation || 0,
|
|
|
|
'fav_star_class' :'icon-star-empty',
|
|
|
|
'post_rep' : 0,
|
|
|
|
'edited-class': 'none',
|
|
|
|
'picture' : data.picture,
|
|
|
|
'editor': '',
|
|
|
|
'signature' : marked(data.signature || ''),
|
|
|
|
}
|
|
|
|
'timestamp' : timestamp,
|
|
|
|
]
|
|
|
|
'relativeTime': utils.relativeTime(timestamp),
|
|
|
|
};
|
|
|
|
'fav_star_class' :'icon-star-empty',
|
|
|
|
|
|
|
|
'edited-class': 'none',
|
|
|
|
|
|
|
|
'editor': '',
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
posts.addUserInfoToPost(socketData['posts'][0], function() {
|
|
|
|
io.sockets.in('topic_' + tid).emit('event:new_post', socketData);
|
|
|
|
io.sockets.in('topic_' + tid).emit('event:new_post', socketData);
|
|
|
|
io.sockets.in('recent_posts').emit('event:new_post', socketData);
|
|
|
|
io.sockets.in('recent_posts').emit('event:new_post', socketData);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
socket.emit('event:alert', {
|
|
|
|
socket.emit('event:alert', {
|
|
|
|
title: 'Reply Unsuccessful',
|
|
|
|
title: 'Reply Unsuccessful',
|
|
|
|