Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Turned off autopublish

  • Loading branch information...
commit 8c02d819807d09f5e51a5e03cdfe3f5339c79c3c 1 parent d14c590
@zquestz authored
Showing with 11 additions and 1 deletion.
  1. +0 −1  .meteor/packages
  2. +11 −0 simplechat.js
View
1  .meteor/packages
@@ -3,6 +3,5 @@
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.
-autopublish
jquery
less
View
11 simplechat.js
@@ -2,6 +2,9 @@ Messages = new Meteor.Collection("messages");
Users = new Meteor.Collection("users");
if (Meteor.is_client) {
+ Meteor.subscribe("messages");
+ Meteor.subscribe("users");
+
Template.chat.messages = function () {
var messages = Messages.find({user: { $exists: true }, text: { $exists: true }, date: { $exists: true} }, { sort: {date: 1} });
var handle = messages.observe({
@@ -124,6 +127,14 @@ if (Meteor.is_client) {
if (Meteor.is_server) {
Meteor.startup(function () {});
+ Meteor.publish("messages", function () {
+ return Messages.find({}, {limit: 1024});
+ });
+
+ Meteor.publish("users", function () {
+ return Users.find({}, {limit: 5000});
+ });
+
Meteor.setInterval(function () {
var now = (new Date()).getTime();
Please sign in to comment.
Something went wrong with that request. Please try again.