Created
August 9, 2012 19:50
-
-
Save MeLight/3307484 to your computer and use it in GitHub Desktop.
Is this supposed to publish?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Server | |
Meteor.publish("requests", function(player_id) { | |
var self = this; | |
var uuid = Meteor.uuid(); | |
var handle = Calls.find({toUser: player_id, status: "request"}).observe({ | |
added : function(doc) { | |
self.set("requests", uuid, doc); | |
self.flush(); | |
} | |
}); | |
}); | |
//Client | |
Meteor.subscribe("requests", Session.get('player_id'), function(){ | |
var call = Requests.findOne(); | |
Meteor.call("answerCall", call._id); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment