Created
August 8, 2012 22:57
-
-
Save MeLight/3299564 to your computer and use it in GitHub Desktop.
Do I need autosub here?
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
//Client | |
Meteor.subscribe("requests", Session.get('player_id'), function(){ | |
var call = Calls.findOne(); | |
Meteor.call("answerCall", call._id); | |
}); | |
//Server | |
Meteor.publish("requests", function(player_id) { | |
if(player_id == undefined) return null; | |
return Calls.find({toUser: player_id, status: "request"}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment