From 84ab276e3b0eacbf85f569f7b6dc7de31cdfa468 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Tue, 12 Jan 2016 16:26:46 -0500 Subject: [PATCH 1/8] added sendFile and sendHtml. Adapter saves map of rooms to ids" --- package.json | 2 +- src/hipchat.coffee | 161 +++++++++++++++++++++++++++++++++++---------- 2 files changed, 126 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 704f183..53b9703 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "license": "MIT", "main": "./src/hipchat", "engines": { - "node" : "~0.12.2" + "node": "~0.12.2" }, "dependencies": { "node-xmpp-client": "^2.1.0", diff --git a/src/hipchat.coffee b/src/hipchat.coffee index d114d6c..8dbdb26 100644 --- a/src/hipchat.coffee +++ b/src/hipchat.coffee @@ -3,50 +3,130 @@ HTTPS = require "https" {inspect} = require "util" Connector = require "./connector" promise = require "./promises" +requestLib = require "request" +fs = require 'fs' +mime = require 'mime' class HipChat extends Adapter constructor: (robot) -> super robot @logger = robot.logger + @room_endpoint = "http://www.hipchat.com/v2/room" reconnectTimer = null emote: (envelope, strings...) -> @send envelope, strings.map((str) -> "/me #{str}")... - send: (envelope, strings...) -> + extractJid: (envelope) -> {user, room} = envelope user = envelope if not user # pre-2.4.2 style + # most common case - we're replying to a user in a room or 1-1 + user?.reply_to or + # allows user objects to be passed in + user?.jid or + if user?.search?(/@/) >= 0 + user # allows user to be a jid string + else + room # this will happen if someone uses robot.messageRoom(jid, ...) - target_jid = - # most common case - we're replying to a user in a room or 1-1 - user?.reply_to or - # allows user objects to be passed in - user?.jid or - if user?.search?(/@/) >= 0 - user # allows user to be a jid string - else - room # this will happen if someone uses robot.messageRoom(jid, ...) + send: (envelope, strings...) -> + + target_jid = extractJid(envelope) + if not target_jid return @logger.error "ERROR: Not sure who to send to: envelope=#{inspect envelope}" for str in strings @connector.message target_jid, str + sendHtml: (envelope, strings...) -> + target_jid = extractJid(envelope) + target_id = @room_map[target_jid] + + if not target_id + return @logger.error "ERROR: Not sure who to send html message to: envelope=#{inspect envelope}" + + if not @options.token + return @logger.error "ERROR: A hubot api token must be set to send html messages" + + fullMsg = strings.join('') + + params = + url: "#{@room_endpoint}" + headers : + 'content-type' : 'text/html' + auth: + bearer : @options.token + body: fullMsg + + requestLib.post params, (err,resp,body) -> + if err || response.statusCode >= 400 + return @logger.error "Hipchat API error: #{resp.statusCode}" + + # Send a file from hubot to a room + # options = + # name : the name to share the file with + # path : send file from this path (a string) + # data : send this base64 encoded data as a file + # type (required) : the type of the file (text, pdf, json, csv etc...) + # msg (optional) : a simple text msg to be posted along with the file + sendFile: (envelope, file_info) -> + target_jid = extractJid(envelope) + target_id = @room_map[target_jid] + + if not target_id + return @logger.error "ERROR: Not sure who to send html message to: envelope=#{inspect envelope}" + + if not @options.token + return @logger.error "ERROR: A hubot api token must be set to send html messages" + + url = "#{@room_endpoint}/#{target_id}/share/file" + mimeType = mime.lookup(file_info.type) + ext = mime.extension(mimeType) + + if not file_info.type || not mimeType + return @logger.error "ERROR: a valid type must be provided to sendFile. Type was: #{file_info.type}" + + if not file_info.msg + file_info.msg = '' + + if file_info.path + fs.readFile file_info.path, (err, data) -> + if err + return @logger.error "File Read Error: could not read from file path: #{file_info.path}" + + sendMultipart url, file_info.name + ext, data, mimeType, file_info.msg + + else if file_info.data + sendMultipart url, file_info.name, data, mimeType, file_info.msg + + else + return @logger.error "ERROR: must specify either data or path for sendFile" + + sendMutlipart: (path, name, data, mimeType, msg) -> + params = + url: path + auth: + bearer: @options.token + multipart: [ + 'Content-Type': 'application/json; charset UTF-8', + 'Content-Disposition': 'attachment; name="metadata"', + 'body': JSON.stringify 'message': msg + , + 'Content-Type': 'file/' + mimeType, + 'Content-Disposition': `attachment; name="file"; filename="${name}"`, + 'body': data + ] + + requestLib params, (err, resp, body) -> + if resp.statusCode > 400 + return @logger.error "Hipchat API errror: #{resp.statusCode}" + topic: (envelope, message) -> - {user, room} = envelope - user = envelope if not user # pre-2.4.2 style - target_jid = - # most common case - we're replying to a user in a room or 1-1 - user?.reply_to or - # allows user objects to be passed in - user?.jid or - if user?.search?(/@/) >= 0 - user # allows user to be a jid string - else - room # this will happen if someone uses robot.messageRoom(jid, ...) + target_jid = extractJid(envelope) if not target_jid return @logger.error "ERROR: Not sure who to send to: envelope=#{inspect envelope}" @@ -158,21 +238,30 @@ class HipChat extends Adapter init .done (users) => saveUsers(users) - # Join requested rooms - if @options.rooms is "All" or @options.rooms is "@All" - connector.getRooms (err, rooms, stanza) => - if rooms - for room in rooms - if !@options.rooms_join_public && room.guest_url != '' - @logger.info "Not joining #{room.jid} because it is a public room" - else - joinRoom(room.jid) - else - @logger.error "Can't list rooms: #{errmsg err}" - # Join all rooms - else - for room_jid in @options.rooms.split "," - joinRoom(room_jid) + + connector.getRooms (err, rooms, stanza) => + + # Save room data to make api calls + if rooms + @room_map = {} + for room in rooms: + @room_map[room.jid] = room + + # Join all rooms + if @options.rooms is "All" or @options.rooms is "@All" + if rooms + for room in rooms + if !@options.rooms_join_public && room.guest_url != '' + @logger.info "Not joining #{room.jid} because it is a public room" + else + joinRoom(room.jid) + else + @logger.error "Can't list rooms: #{errmsg err}" + # Join requested rooms + else + for room_jid in @options.rooms.split "," + joinRoom(room_jid) + .fail (err) => @logger.error "Can't list users: #{errmsg err}" if err From 332b1e13d5457a12771addee16f7bebdf7270c48 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Tue, 12 Jan 2016 16:40:42 -0500 Subject: [PATCH 2/8] updated node modules --- package.json | 3 +++ src/hipchat.coffee | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 53b9703..82b0a87 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,10 @@ "node": "~0.12.2" }, "dependencies": { + "fs": "0.0.2", + "mime": "^1.3.4", "node-xmpp-client": "^2.1.0", + "request": "^2.67.0", "rsvp": "~1.2.0", "underscore": "~1.4.4" } diff --git a/src/hipchat.coffee b/src/hipchat.coffee index 8dbdb26..cd0504e 100644 --- a/src/hipchat.coffee +++ b/src/hipchat.coffee @@ -100,7 +100,7 @@ class HipChat extends Adapter sendMultipart url, file_info.name + ext, data, mimeType, file_info.msg else if file_info.data - sendMultipart url, file_info.name, data, mimeType, file_info.msg + sendMultipart url, file_info.name + ext, data, mimeType, file_info.msg else return @logger.error "ERROR: must specify either data or path for sendFile" @@ -120,7 +120,7 @@ class HipChat extends Adapter 'body': data ] - requestLib params, (err, resp, body) -> + requestLib.post params, (err, resp, body) -> if resp.statusCode > 400 return @logger.error "Hipchat API errror: #{resp.statusCode}" From 90be6f6df5b4b28ff3e95fa17b444d0cb2c6a583 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Wed, 13 Jan 2016 02:25:26 -0500 Subject: [PATCH 3/8] finished with adapter additions --- package.json | 4 ++ src/hipchat.coffee | 100 ++++++++++++++++++++++++++------------------ src/response.coffee | 11 +++++ 3 files changed, 74 insertions(+), 41 deletions(-) create mode 100644 src/response.coffee diff --git a/package.json b/package.json index 82b0a87..61f73e1 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,12 @@ "engines": { "node": "~0.12.2" }, + "peerDependencies": { + "hubot": ">=2.0" + }, "dependencies": { "fs": "0.0.2", + "hubot": "^2.17.0", "mime": "^1.3.4", "node-xmpp-client": "^2.1.0", "request": "^2.67.0", diff --git a/src/hipchat.coffee b/src/hipchat.coffee index cd0504e..51f8d9a 100644 --- a/src/hipchat.coffee +++ b/src/hipchat.coffee @@ -6,6 +6,7 @@ promise = require "./promises" requestLib = require "request" fs = require 'fs' mime = require 'mime' +HipchatResponse = require './response' class HipChat extends Adapter @@ -13,6 +14,7 @@ class HipChat extends Adapter super robot @logger = robot.logger @room_endpoint = "http://www.hipchat.com/v2/room" + @robot.Response = HipchatResponse reconnectTimer = null emote: (envelope, strings...) -> @@ -30,42 +32,49 @@ class HipChat extends Adapter else room # this will happen if someone uses robot.messageRoom(jid, ...) + getRoomDetails: (envelope) -> + jid = @extractJid(envelope) + + if not jid + return @logger.error "ERROR: Details for this room do not exist" + + return @room_map[jid] send: (envelope, strings...) -> - - target_jid = extractJid(envelope) + + target_jid = @extractJid(envelope) if not target_jid - return @logger.error "ERROR: Not sure who to send to: envelope=#{inspect envelope}" + return @logger.error "Not sure who to send to: envelope=#{inspect envelope}" for str in strings @connector.message target_jid, str sendHtml: (envelope, strings...) -> - target_jid = extractJid(envelope) - target_id = @room_map[target_jid] + target_jid = @extractJid(envelope) - if not target_id - return @logger.error "ERROR: Not sure who to send html message to: envelope=#{inspect envelope}" + if not target_jid + return @logger.error "Not sure who to send html message to: envelope=#{inspect envelope}" if not @options.token - return @logger.error "ERROR: A hubot api token must be set to send html messages" + return @logger.error "A hubot api token must be set to send html messages" + room_id = @room_map[target_jid].id fullMsg = strings.join('') params = - url: "#{@room_endpoint}" + url: "#{@room_endpoint}/#{room_id}/notification" headers : 'content-type' : 'text/html' auth: bearer : @options.token body: fullMsg - requestLib.post params, (err,resp,body) -> - if err || response.statusCode >= 400 + requestLib.post params, (err,resp,body) => + if err || resp.statusCode >= 400 return @logger.error "Hipchat API error: #{resp.statusCode}" - # Send a file from hubot to a room + # Send a file from hubot # options = # name : the name to share the file with # path : send file from this path (a string) @@ -73,56 +82,65 @@ class HipChat extends Adapter # type (required) : the type of the file (text, pdf, json, csv etc...) # msg (optional) : a simple text msg to be posted along with the file sendFile: (envelope, file_info) -> - target_jid = extractJid(envelope) - target_id = @room_map[target_jid] + target_jid = @extractJid(envelope) - if not target_id - return @logger.error "ERROR: Not sure who to send html message to: envelope=#{inspect envelope}" + if not target_jid + return @logger.error "Not sure who to send file to: envelope=#{inspect envelope}" if not @options.token - return @logger.error "ERROR: A hubot api token must be set to send html messages" + return @logger.error "A hubot api token must be set to send html messages" - url = "#{@room_endpoint}/#{target_id}/share/file" + room_id = @room_map[target_jid].id + url = "#{@room_endpoint}/#{room_id}/share/file" mimeType = mime.lookup(file_info.type) ext = mime.extension(mimeType) if not file_info.type || not mimeType - return @logger.error "ERROR: a valid type must be provided to sendFile. Type was: #{file_info.type}" + return @logger.error "A valid type must be provided to sendFile. Type was: #{file_info.type}" if not file_info.msg file_info.msg = '' if file_info.path - fs.readFile file_info.path, (err, data) -> + fs.readFile file_info.path, (err, data) => if err return @logger.error "File Read Error: could not read from file path: #{file_info.path}" - sendMultipart url, file_info.name + ext, data, mimeType, file_info.msg + @sendMultipart url, file_info.name + '.' + ext, data, mimeType, file_info.msg else if file_info.data - sendMultipart url, file_info.name + ext, data, mimeType, file_info.msg + @sendMultipart url, file_info.name + '.' + ext, file_info.data, mimeType, file_info.msg else - return @logger.error "ERROR: must specify either data or path for sendFile" + return @logger.error "Must specify either data or path for sendFile" + + sendMultipart: (path, name, data, mimeType, msg) -> - sendMutlipart: (path, name, data, mimeType, msg) -> + # Weird stuff from the hipchat api + # Must have filename="name" etc... with double quotes not single params = + method: 'POST' url: path auth: bearer: @options.token multipart: [ - 'Content-Type': 'application/json; charset UTF-8', - 'Content-Disposition': 'attachment; name="metadata"', - 'body': JSON.stringify 'message': msg + { + "Content-Type": "application/json; charset UTF-8", + "Content-Disposition": 'attachment; name="metadata"', + "body": JSON.stringify "message": msg + } , - 'Content-Type': 'file/' + mimeType, - 'Content-Disposition': `attachment; name="file"; filename="${name}"`, - 'body': data + { + "Content-Type": "file/" + mimeType, + "Content-Disposition": 'attachment; name="file"; filename="' + name + '"', + "body": data + } ] - requestLib.post params, (err, resp, body) -> - if resp.statusCode > 400 + requestLib params, (err, resp, body) => + if resp.statusCode >= 400 return @logger.error "Hipchat API errror: #{resp.statusCode}" + topic: (envelope, message) -> @@ -244,19 +262,19 @@ class HipChat extends Adapter # Save room data to make api calls if rooms @room_map = {} - for room in rooms: + for room in rooms @room_map[room.jid] = room # Join all rooms if @options.rooms is "All" or @options.rooms is "@All" - if rooms - for room in rooms - if !@options.rooms_join_public && room.guest_url != '' - @logger.info "Not joining #{room.jid} because it is a public room" - else - joinRoom(room.jid) - else - @logger.error "Can't list rooms: #{errmsg err}" + if rooms + for room in rooms + if !@options.rooms_join_public && room.guest_url != '' + @logger.info "Not joining #{room.jid} because it is a public room" + else + joinRoom(room.jid) + else + @logger.error "Can't list rooms: #{errmsg err}" # Join requested rooms else for room_jid in @options.rooms.split "," diff --git a/src/response.coffee b/src/response.coffee new file mode 100644 index 0000000..70e2812 --- /dev/null +++ b/src/response.coffee @@ -0,0 +1,11 @@ +{Response} = require 'hubot' + +class HipchatResponse extends Response + + sendFile: (file_info) -> + @robot.adapter.sendFile(@envelope, file_info) + + sendHtml: (strings...) -> + @robot.adapter.sendHtml(@envelope, strings...) + +module.exports = HipchatResponse \ No newline at end of file From f649ecadb8d404ed10de15e7843a18e34d1b5327 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Wed, 13 Jan 2016 02:34:22 -0500 Subject: [PATCH 4/8] fixed package.json and cleaned up some things --- package.json | 4 ---- src/hipchat.coffee | 10 +--------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/package.json b/package.json index 61f73e1..82b0a87 100644 --- a/package.json +++ b/package.json @@ -19,12 +19,8 @@ "engines": { "node": "~0.12.2" }, - "peerDependencies": { - "hubot": ">=2.0" - }, "dependencies": { "fs": "0.0.2", - "hubot": "^2.17.0", "mime": "^1.3.4", "node-xmpp-client": "^2.1.0", "request": "^2.67.0", diff --git a/src/hipchat.coffee b/src/hipchat.coffee index 51f8d9a..2c9a5ee 100644 --- a/src/hipchat.coffee +++ b/src/hipchat.coffee @@ -32,20 +32,12 @@ class HipChat extends Adapter else room # this will happen if someone uses robot.messageRoom(jid, ...) - getRoomDetails: (envelope) -> - jid = @extractJid(envelope) - - if not jid - return @logger.error "ERROR: Details for this room do not exist" - - return @room_map[jid] - send: (envelope, strings...) -> target_jid = @extractJid(envelope) if not target_jid - return @logger.error "Not sure who to send to: envelope=#{inspect envelope}" + return @logger.error "ERROR: Not sure who to send to: envelope=#{inspect envelope}" for str in strings @connector.message target_jid, str From 32313e75e1355a065117b3a7507deb84c056af21 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Wed, 13 Jan 2016 23:02:36 -0500 Subject: [PATCH 5/8] add to readme. fix package.json to remove fs. fix some comment typos --- README.md | 25 +++++++++++++++++++++++++ package.json | 1 - src/hipchat.coffee | 28 ++++++++++++++-------------- src/response.coffee | 4 ++-- 4 files changed, 41 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 269e929..151baeb 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,27 @@ Bonus: Add a notification hook to Heroku so a notification is sent to a room whe robot.messageRoom("1234_room@conf.hipchat.com", "message"); ``` +## hubot-hipchat specific featues + +In addition to the response methods provided by the normal hubot, such as ```resp.send```, hubot-hipchat provides these hipchat specific functions: +* ```resp.sendHtml``` takes any number of strings and sticks them together as one html message post. For example, you can send a hyperlink by doing this: +``` +robot.respond /send hyperlink/i, (resp)-> + resp.sendHtml "hipchat site" +``` + +* ```resp.sendFile``` takes an object that contains either file data or a path to a file along with other file info and posts the file to a room with an optional message: +``` +robot.respond /send file/i, (resp) -> + file_info = + name : "the name people will see in the room" + path : 'path/to/file.text' + type: "text" # required + msg : "optional message to post when file is uploaded" + + resp.sendFile file_info +``` + ## Adapter configuration This adapter uses the following environment variables: @@ -135,6 +156,10 @@ Optional. Set to `debug` to enable detailed debug logging. Optional. Seting to `false` will prevent the HipChat adapter from auto-reconnecting if it detects a server error or disconnection. +### HUBOT\_HIPCHAT\_TOKEN + +Optional. Set to the value of an API token for HipChat. Generate an API token [here](https://cs10.hipchat.com/account/api) (and give it the necessary scopes to post in rooms, the easiest way is just give it access to all scopes). This needs to be set in order to use the sendFile and sendHtml methods. + ## Running locally To run locally on OSX or Linux you'll need to set the required environment variables and run the `bin/hubot` script. An example script to run the bot might look like: diff --git a/package.json b/package.json index 82b0a87..67c6158 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "node": "~0.12.2" }, "dependencies": { - "fs": "0.0.2", "mime": "^1.3.4", "node-xmpp-client": "^2.1.0", "request": "^2.67.0", diff --git a/src/hipchat.coffee b/src/hipchat.coffee index 2c9a5ee..fa2ab3c 100644 --- a/src/hipchat.coffee +++ b/src/hipchat.coffee @@ -1,12 +1,12 @@ -{Adapter, TextMessage, EnterMessage, LeaveMessage, TopicMessage, User} = require "hubot" +fs = require "fs" HTTPS = require "https" +{Adapter, TextMessage, EnterMessage, LeaveMessage, TopicMessage, User} = require "hubot" {inspect} = require "util" +requestLib = require "request" # requestLib to avoid confusion with adapter's request method +mime = require "mime" Connector = require "./connector" promise = require "./promises" -requestLib = require "request" -fs = require 'fs' -mime = require 'mime' -HipchatResponse = require './response' +HipChatResponse = require './response' class HipChat extends Adapter @@ -14,7 +14,7 @@ class HipChat extends Adapter super robot @logger = robot.logger @room_endpoint = "http://www.hipchat.com/v2/room" - @robot.Response = HipchatResponse + @robot.Response = HipChatResponse reconnectTimer = null emote: (envelope, strings...) -> @@ -49,7 +49,7 @@ class HipChat extends Adapter return @logger.error "Not sure who to send html message to: envelope=#{inspect envelope}" if not @options.token - return @logger.error "A hubot api token must be set to send html messages" + return @logger.error "Must set HUBOT_HIPCHAT_TOKEN to send html messages" room_id = @room_map[target_jid].id fullMsg = strings.join('') @@ -64,10 +64,10 @@ class HipChat extends Adapter requestLib.post params, (err,resp,body) => if err || resp.statusCode >= 400 - return @logger.error "Hipchat API error: #{resp.statusCode}" + return @logger.error "HipChat API error: #{resp.statusCode}" # Send a file from hubot - # options = + # file_info = # name : the name to share the file with # path : send file from this path (a string) # data : send this base64 encoded data as a file @@ -80,7 +80,7 @@ class HipChat extends Adapter return @logger.error "Not sure who to send file to: envelope=#{inspect envelope}" if not @options.token - return @logger.error "A hubot api token must be set to send html messages" + return @logger.error "Must set HUBOT_HIPCHAT_TOKEN to send html messages" room_id = @room_map[target_jid].id url = "#{@room_endpoint}/#{room_id}/share/file" @@ -108,8 +108,8 @@ class HipChat extends Adapter sendMultipart: (path, name, data, mimeType, msg) -> - # Weird stuff from the hipchat api - # Must have filename="name" etc... with double quotes not single + # Must have filename="name" etc... in double quotes not single + quotedName = '"' + name + '"' params = method: 'POST' url: path @@ -124,14 +124,14 @@ class HipChat extends Adapter , { "Content-Type": "file/" + mimeType, - "Content-Disposition": 'attachment; name="file"; filename="' + name + '"', + "Content-Disposition": 'attachment; name="file"; filename=' + quotedName, "body": data } ] requestLib params, (err, resp, body) => if resp.statusCode >= 400 - return @logger.error "Hipchat API errror: #{resp.statusCode}" + return @logger.error "HipChat API errror: #{resp.statusCode}" topic: (envelope, message) -> diff --git a/src/response.coffee b/src/response.coffee index 70e2812..3f7db7a 100644 --- a/src/response.coffee +++ b/src/response.coffee @@ -1,6 +1,6 @@ {Response} = require 'hubot' -class HipchatResponse extends Response +class HipChatResponse extends Response sendFile: (file_info) -> @robot.adapter.sendFile(@envelope, file_info) @@ -8,4 +8,4 @@ class HipchatResponse extends Response sendHtml: (strings...) -> @robot.adapter.sendHtml(@envelope, strings...) -module.exports = HipchatResponse \ No newline at end of file +module.exports = HipChatResponse \ No newline at end of file From 2620dbaf06b5310e09447a7b363526e4f8da6c4f Mon Sep 17 00:00:00 2001 From: Travis CI Date: Wed, 13 Jan 2016 23:06:32 -0500 Subject: [PATCH 6/8] fix readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 151baeb..a14b23a 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Bonus: Add a notification hook to Heroku so a notification is sent to a room whe robot.messageRoom("1234_room@conf.hipchat.com", "message"); ``` -## hubot-hipchat specific featues +## Features specific to hubot-hipchat In addition to the response methods provided by the normal hubot, such as ```resp.send```, hubot-hipchat provides these hipchat specific functions: * ```resp.sendHtml``` takes any number of strings and sticks them together as one html message post. For example, you can send a hyperlink by doing this: From 7374cfce88890cef9743c9246703002da0c71cf5 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Wed, 13 Jan 2016 23:16:27 -0500 Subject: [PATCH 7/8] need to check out the envelope data for a second. --- src/hipchat.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hipchat.coffee b/src/hipchat.coffee index fa2ab3c..d9a7106 100644 --- a/src/hipchat.coffee +++ b/src/hipchat.coffee @@ -35,6 +35,7 @@ class HipChat extends Adapter send: (envelope, strings...) -> target_jid = @extractJid(envelope) + @logger.info inspect envelope if not target_jid return @logger.error "ERROR: Not sure who to send to: envelope=#{inspect envelope}" From 087a572f353e734f2518103da0c450095fb1f8a7 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Wed, 13 Jan 2016 23:32:42 -0500 Subject: [PATCH 8/8] verified what I thought --- src/hipchat.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hipchat.coffee b/src/hipchat.coffee index d9a7106..fa2ab3c 100644 --- a/src/hipchat.coffee +++ b/src/hipchat.coffee @@ -35,7 +35,6 @@ class HipChat extends Adapter send: (envelope, strings...) -> target_jid = @extractJid(envelope) - @logger.info inspect envelope if not target_jid return @logger.error "ERROR: Not sure who to send to: envelope=#{inspect envelope}"