mirror of
https://github.com/cnodejs/nodeclub.git
synced 2025-12-08 19:55:55 +00:00
filter invalid messages
This commit is contained in:
parent
72ef6d4609
commit
30c7a6bd99
@ -19,6 +19,9 @@ exports.index = function (req, res, next) {
|
||||
var epfill = new eventproxy();
|
||||
epfill.fail(next);
|
||||
epfill.after('message_ready', msgs.length, function (docs) {
|
||||
docs.filter(function (doc) {
|
||||
return !doc.is_invalid;
|
||||
});
|
||||
ep.emit(idx === 0 ? 'has_read_messages' : 'hasnot_read_messages', docs);
|
||||
});
|
||||
msgs.forEach(function (doc) {
|
||||
|
||||
@ -5,23 +5,23 @@
|
||||
<% } %>
|
||||
<% if(message.type == 'reply'){ %>
|
||||
<span>
|
||||
<a href="/user/<%= message.author.name %>" target='_blank'><%= message.author.name %></a>
|
||||
回复了你的话题
|
||||
<a href="/user/<%= message.author.name %>" target='_blank'><%= message.author.name %></a>
|
||||
回复了你的话题
|
||||
<a href="/topic/<%- message.topic._id + (message.reply ? '#' + message.reply._id : '') %>" target='_blank'><%= message.topic.title %></a>
|
||||
</span>
|
||||
<% } %>
|
||||
<% if(message.type == 'reply2'){ %>
|
||||
<span>
|
||||
<a href="/user/<%= message.author.name %>" target='_blank'><%= message.author.name %></a>
|
||||
在话题
|
||||
<a href="/user/<%= message.author.name %>" target='_blank'><%= message.author.name %></a>
|
||||
在话题
|
||||
<a href="/topic/<%= message.topic._id + (message.reply ? '#' + message.reply._id : '') %>" target='_blank'><%= message.topic.title %></a>
|
||||
中回复了你的回复
|
||||
</span>
|
||||
<% } %>
|
||||
<% if(message.type == 'follow'){ %>
|
||||
<span>
|
||||
<a href="/user/<%= message.author.name %>" target='_blank'><%= message.author.name %></a>
|
||||
关注了你
|
||||
<a href="/user/<%= message.author.name %>" target='_blank'><%= message.author.name %></a>
|
||||
关注了你
|
||||
</span>
|
||||
<% } %>
|
||||
<% if (message.type == 'at'){ %>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user