summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorDaniel Aquino <daniel.aquino@nasdaqomx.com>2014-11-08 23:04:31 -0600
committerDoug Goldstein <cardoe@cardoe.com>2014-11-19 21:27:24 -0600
commit1353f9aa643f86a3f38f3d2dfa8666d3d942293e (patch)
treeefc38a5729d7f1fe920d39d279f6c8eef833fd17 /app/models
parent2f3df4cb567a6f14b5a0e161084c2f4cf6fbf764 (diff)
downloadgitlab-ce-1353f9aa643f86a3f38f3d2dfa8666d3d942293e.tar.gz
HipChat service: support custom servers
HipChat allows users to run their own private servers and to be able to support those we must connect to the correct URL when using one of these custom servers.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project_services/hipchat_service.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/project_services/hipchat_service.rb b/app/models/project_services/hipchat_service.rb
index 2b804687853..a848d74044c 100644
--- a/app/models/project_services/hipchat_service.rb
+++ b/app/models/project_services/hipchat_service.rb
@@ -15,7 +15,7 @@
class HipchatService < Service
MAX_COMMITS = 3
- prop_accessor :token, :room
+ prop_accessor :token, :room, :server
validates :token, presence: true, if: :activated?
def title
@@ -33,7 +33,9 @@ class HipchatService < Service
def fields
[
{ type: 'text', name: 'token', placeholder: '' },
- { type: 'text', name: 'room', placeholder: '' }
+ { type: 'text', name: 'room', placeholder: '' },
+ { type: 'text', name: 'server',
+ placeholder: 'Leave blank for default. https://chat.hipchat.com' }
]
end
@@ -45,6 +47,7 @@ class HipchatService < Service
def gate
options = { api_version: 'v2' }
+ options[:server_url] = server unless server.nil?
@gate ||= HipChat::Client.new(token, options)
end