mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-17 19:12:33 -05:00
Change 'Slack' back to 'HipChat' in multicore and server.
This commit is contained in:
parent
493d302a0d
commit
b5d92d5c26
4 changed files with 6 additions and 6 deletions
|
@ -79,7 +79,7 @@ if cluster.isMaster
|
||||||
hipchat = require './server/hipchat'
|
hipchat = require './server/hipchat'
|
||||||
hipchat.sendHipChatMessage(message, ['tower'], {papertrail: true})
|
hipchat.sendHipChatMessage(message, ['tower'], {papertrail: true})
|
||||||
catch error
|
catch error
|
||||||
console.log "Couldn't send Slack message on server death:", error
|
console.log "Couldn't send HipChat message on server death:", error
|
||||||
cluster.fork()
|
cluster.fork()
|
||||||
else
|
else
|
||||||
require('coffee-script')
|
require('coffee-script')
|
||||||
|
|
|
@ -13,10 +13,10 @@ module.exports.sendHipChatMessage = sendHipChatMessage = (message, rooms, option
|
||||||
options ?= {}
|
options ?= {}
|
||||||
for room in rooms
|
for room in rooms
|
||||||
unless roomID = roomIDMap[room]
|
unless roomID = roomIDMap[room]
|
||||||
log.error "Unknown Slack room #{room}."
|
log.error "Unknown HipChat room #{room}."
|
||||||
continue
|
continue
|
||||||
unless key = config.hipchat[room]
|
unless key = config.hipchat[room]
|
||||||
log.info "No Slack API key for room #{room}."
|
log.info "No HipChat API key for room #{room}."
|
||||||
continue
|
continue
|
||||||
form =
|
form =
|
||||||
color: options.color or 'yellow'
|
color: options.color or 'yellow'
|
||||||
|
@ -32,4 +32,4 @@ module.exports.sendHipChatMessage = sendHipChatMessage = (message, rooms, option
|
||||||
url = "https://api.hipchat.com/v2/room/#{roomID}/notification?auth_token=#{key}"
|
url = "https://api.hipchat.com/v2/room/#{roomID}/notification?auth_token=#{key}"
|
||||||
request.post {uri: url, json: form}, (err, res, body) ->
|
request.post {uri: url, json: form}, (err, res, body) ->
|
||||||
return log.error 'Error sending Slack message:', err or body if err or /error/i.test body
|
return log.error 'Error sending Slack message:', err or body if err or /error/i.test body
|
||||||
#log.info "Got Slack message response:", body
|
#log.info "Got HipChat message response:", body
|
||||||
|
|
|
@ -383,6 +383,6 @@ PaymentHandler = class PaymentHandler extends Handler
|
||||||
message += " for #{options.payment.get('description')}" if options.payment?.get('description')
|
message += " for #{options.payment.get('description')}" if options.payment?.get('description')
|
||||||
hipchat.sendHipChatMessage message, ['tower']
|
hipchat.sendHipChatMessage message, ['tower']
|
||||||
catch e
|
catch e
|
||||||
log.error "Couldn't send Slack message on payment because of error: #{e}"
|
log.error "Couldn't send HipChat message on payment because of error: #{e}"
|
||||||
|
|
||||||
module.exports = new PaymentHandler()
|
module.exports = new PaymentHandler()
|
||||||
|
|
|
@ -192,7 +192,7 @@ class SubscriptionHandler extends Handler
|
||||||
msg = "Year subscription purchased by #{req.user.get('email')} #{req.user.id}"
|
msg = "Year subscription purchased by #{req.user.get('email')} #{req.user.id}"
|
||||||
hipchat.sendHipChatMessage msg, ['tower']
|
hipchat.sendHipChatMessage msg, ['tower']
|
||||||
catch error
|
catch error
|
||||||
@logSubscriptionError(req.user, "Year sub sale Slack tower msg error: #{JSON.stringify(error)}")
|
@logSubscriptionError(req.user, "Year sub sale HipChat tower msg error: #{JSON.stringify(error)}")
|
||||||
@sendSuccess(res, user)
|
@sendSuccess(res, user)
|
||||||
|
|
||||||
subscribeWithPrepaidCode: (req, res) ->
|
subscribeWithPrepaidCode: (req, res) ->
|
||||||
|
|
Loading…
Reference in a new issue