Skip to content

Commit

Permalink
Promises broke things
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeFoodPixels committed May 28, 2016
1 parent c195332 commit 2e5ab19
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ facebook.prototype.connect = function() {
}, {
logLevel: 'silent'
}).then(function(api) {
this.api = bluebird.promisifyAll(api);
this.api = api;

this.api.listenAsync().then(function(message) {
this.api.listen(function(err, message) {
this.messageRecieved(message.threadID, message.body, message.senderID);
this.api.markAsRead(message.threadID)
}.bind(this));

this.addMessageSender(function(message, to) {
Expand Down

0 comments on commit 2e5ab19

Please sign in to comment.