mirror of
https://github.com/cnodejs/nodeclub.git
synced 2025-12-08 19:55:55 +00:00
fix @ bug in topic content
This commit is contained in:
parent
f140211175
commit
e79d034b49
@ -36,27 +36,26 @@ exports.index = function (req, res, next) {
|
||||
error: '此话题不存在或已被删除。'
|
||||
});
|
||||
}
|
||||
var events = [ 'topic', 'other_topics', 'no_reply_topics', 'get_relation', '@user' ];
|
||||
var events = [ 'topic', 'other_topics', 'no_reply_topics', 'get_relation'];
|
||||
var ep = EventProxy.create(events, function (topic, other_topics, no_reply_topics, relation) {
|
||||
res.render('topic/index', {
|
||||
topic: topic,
|
||||
author_other_topics: other_topics,
|
||||
no_reply_topics: no_reply_topics,
|
||||
relation : relation
|
||||
at_ctrl.link_at_who(topic.content, function (err, content) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
topic.content = content;
|
||||
res.render('topic/index', {
|
||||
topic: topic,
|
||||
author_other_topics: other_topics,
|
||||
no_reply_topics: no_reply_topics,
|
||||
relation : relation
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
ep.on('error', function (err) {
|
||||
ep.unbind();
|
||||
next(err);
|
||||
});
|
||||
ep.once('topic', function (topic) {
|
||||
at_ctrl.link_at_who(topic.content, function (err, content) {
|
||||
if (err) {
|
||||
return ep.emit('error', err);
|
||||
}
|
||||
topic.content = content;
|
||||
});
|
||||
});
|
||||
|
||||
get_full_topic(topic_id, function (err, message, topic, tags, author, replies) {
|
||||
if (err) {
|
||||
@ -67,15 +66,6 @@ exports.index = function (req, res, next) {
|
||||
return res.render('notify/notify', { error: message });
|
||||
}
|
||||
|
||||
|
||||
at_ctrl.link_at_who(topic.content, function (err, content) {
|
||||
if (err) {
|
||||
return ep.emit('error', err);
|
||||
}
|
||||
topic.content = content;
|
||||
ep.emit('@user');
|
||||
});
|
||||
|
||||
topic.visit_count += 1;
|
||||
topic.save(function (err) {
|
||||
if (!topic.content_is_html) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user