HipChat Integration

(Rohit Menon) #1


Just setup Discourse and was working on HipChat integration.


Our HipChat setup uses a URL of the format: hipchat.xyzcompany.com. When setting up the HipChat Channel (Plugins>Chat Integrations>HipChat>Add Channel), the Webhook URL does not support the format: hipchat.xyzcompany.com. It expects hipchat.com and so marks entries like hipchat.xyzcompany.com as invalid.

On looking up the code in:

I see that the match is looking for hipchat.com as show below:

module DiscourseChat
  module Provider
    module HipchatProvider
      PROVIDER_NAME = "hipchat".freeze
      PROVIDER_ENABLED_SETTING = :chat_integration_hipchat_enabled
                        { key: "name", regex: '^\S+' },
                        { key: "webhook_url", regex: 'hipchat\.com'', unique: true, hidden: true },
                        { key: "color", regex: '^(yellow|green|red|purple|gray|random)$' }

I believe this is a BUG and it should be able to address URLs such as hipchat.xyzcompany.com.

To test this out I went ahead and tried changing the code and restarted the app. On restart I was able to add hipchat.xyzcompany.com successfully.

Do let me know if you need any information.

(David Taylor) #2

Sounds like a good change to me, I didn’t realise custom hipchat domains were possible when I created the integration.

Are you confident creating a pull request for the change? If not I’m happy to do it :slight_smile:

(Rohit Menon) #3

Hi @David_Taylor

Thanks for reviewing this. I just created a pull request (my first!).

Please review whenever you get the chance.