Permalink
Browse files

Purge messages from the future

  • Loading branch information...
1 parent 9a9e162 commit 04d0857c9fb2485527bc0644db571d936840adf8 @zquestz committed Jul 29, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 simplechat.js
View
@@ -167,6 +167,10 @@ if (Meteor.is_server) {
Users.find({last_seen: {$lt: (now - 60 * 1000)}}).forEach(function (user) {
Users.remove(user._id);
});
+
+ Messages.find({date: {$gt: (now)}}).forEach(function (message) {
+ Messages.remove(message._id);
+ });
});
Meteor.methods({

0 comments on commit 04d0857

Please sign in to comment.