{"action":"created","issue":{"url":"https://api.github.com/repos/hipchat/hubot-hipchat/issues/270","repository_url":"https://api.github.com/repos/hipchat/hubot-hipchat","labels_url":"https://api.github.com/repos/hipchat/hubot-hipchat/issues/270/labels{/name}","comments_url":"https://api.github.com/repos/hipchat/hubot-hipchat/issues/270/comments","events_url":"https://api.github.com/repos/hipchat/hubot-hipchat/issues/270/events","html_url":"https://github.com/hipchat/hubot-hipchat/pull/270","id":126575717,"number":270,"title":"New Features: sendFile and sendHtml","user":{"login":"aaaschmitt","id":5624779,"avatar_url":"https://avatars.githubusercontent.com/u/5624779?v=3","gravatar_id":"","url":"https://api.github.com/users/aaaschmitt","html_url":"https://github.com/aaaschmitt","followers_url":"https://api.github.com/users/aaaschmitt/followers","following_url":"https://api.github.com/users/aaaschmitt/following{/other_user}","gists_url":"https://api.github.com/users/aaaschmitt/gists{/gist_id}","starred_url":"https://api.github.com/users/aaaschmitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaaschmitt/subscriptions","organizations_url":"https://api.github.com/users/aaaschmitt/orgs","repos_url":"https://api.github.com/users/aaaschmitt/repos","events_url":"https://api.github.com/users/aaaschmitt/events{/privacy}","received_events_url":"https://api.github.com/users/aaaschmitt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-01-14T04:39:23Z","updated_at":"2016-09-30T05:34:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hipchat/hubot-hipchat/pulls/270","html_url":"https://github.com/hipchat/hubot-hipchat/pull/270","diff_url":"https://github.com/hipchat/hubot-hipchat/pull/270.diff","patch_url":"https://github.com/hipchat/hubot-hipchat/pull/270.patch"},"body":"This pr adds some HipChat specific functionality. Check the updated README for usage, but an example script can also be found [here](https://github.com/cs10/Alonzo/blob/master/scripts/test_scripts/adapterTest.coffee).\r\n\r\nThis pr adds two new functions to the response object that an executed script receives ```resp.sendHtml``` and ```resp.sendFile```.  There was a bit of a trick to adding these new features as the standard hubot response does not have these features. I extended the hubot Response class with a HipChatResponse object that contains these two new methods. Then when the adapter is initialized it replaces the robot's response object with its own.\r\n\r\nAny comments would be greatly appreciated, but I'm sure myself and others would love to see this pulled in as part of the adapter."},"comment":{"url":"https://api.github.com/repos/hipchat/hubot-hipchat/issues/comments/250662431","html_url":"https://github.com/hipchat/hubot-hipchat/pull/270#issuecomment-250662431","issue_url":"https://api.github.com/repos/hipchat/hubot-hipchat/issues/270","id":250662431,"user":{"login":"aaaschmitt","id":5624779,"avatar_url":"https://avatars.githubusercontent.com/u/5624779?v=3","gravatar_id":"","url":"https://api.github.com/users/aaaschmitt","html_url":"https://github.com/aaaschmitt","followers_url":"https://api.github.com/users/aaaschmitt/followers","following_url":"https://api.github.com/users/aaaschmitt/following{/other_user}","gists_url":"https://api.github.com/users/aaaschmitt/gists{/gist_id}","starred_url":"https://api.github.com/users/aaaschmitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaaschmitt/subscriptions","organizations_url":"https://api.github.com/users/aaaschmitt/orgs","repos_url":"https://api.github.com/users/aaaschmitt/repos","events_url":"https://api.github.com/users/aaaschmitt/events{/privacy}","received_events_url":"https://api.github.com/users/aaaschmitt/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T05:34:06Z","updated_at":"2016-09-30T05:34:06Z","body":"I believe that the hipchat adapter is not really accepting new features anymore so I doubt that this will ever be pulled in. There is also more of a meta discussion (I believe it was somewhere in the slack adapter forum) around whether or not the adapters base functionality should actually be extended like this. The problem being that this then leads to adapters diverging in functionality from each other, which then means that even more scripts will be tied to a particular chat platform. \r\n\r\nAs of late I have also stopped using hipchat for my work so I am probably not going to be maintaining these features. I highly encourage anyone to pull them into their branches though or use the concepts presented here to make other cool things, particularly how you can attach new functions to the response object!\r\n\r\n@jonyeezs That may be true but if you have another plugin that does the same thing then maybe you should ask yourself why you have that plug in? Also do plugins usually modify the adapter interface (maybe they do)? I thought usually you just include scripts which can then only interface through the adapter. In those cases, which is all I have worked with, there will be no collisions since this functionality is in the adapter itself. \r\n\r\nI also don't see how what you've proposed is better. There are certainly cases where someone would want to share raw html text in a chat room (particularly if the chat room is among a bunch of programmers) so auto detection here is not a good option. You also haven't addressed how you would avoid collisions with sendFile (I'm guessing you meant to write that instead of sendLink) since having it auto detect resp.send(\"myfile.txt\") I don't think is a good solution."}}
{"actor":{"display_login":"aaaschmitt"}}