Permalink
Browse files

Merge pull request #1328 from parkr/fix-pr-notifier

 Fix pull request notifier so it works.
  • Loading branch information...
2 parents d239b69 + 03e7caf commit a98534ae169c0d869e6cf40549bf90d426463b6e @technicalpickles technicalpickles committed Feb 14, 2014
Showing with 7 additions and 8 deletions.
  1. +7 −8 src/scripts/github-pull-request-notifier.coffee
@@ -27,22 +27,21 @@ url = require('url')
querystring = require('querystring')
module.exports = (robot) ->
-
robot.router.post "/hubot/gh-pull-requests", (req, res) ->
query = querystring.parse(url.parse(req.url).query)
- res.end
-
- user = {}
- user.room = query.room if query.room
- user.type = query.type if query.type
+ data = req.body
+ room = query.room
try
- announcePullRequest req.body, (what) ->
- robot.send user, what
+ announcePullRequest data, (what) ->
+ robot.messageRoom room, what
catch error
+ robot.messageRoom room, "Whoa, I got an error: #{error}"
console.log "github pull request notifier error: #{error}. Request: #{req.body}"
+ res.end ""
+
announcePullRequest = (data, cb) ->
if data.action == 'opened'

0 comments on commit a98534a

Please sign in to comment.