summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-07-27 11:29:05 +0200
committerRémy Coutable <remy@rymai.me>2016-07-27 11:29:05 +0200
commit386478d800e2e098371d27817ebda6627d6838bc (patch)
tree0d29f8e59f7fe502af986de41497b2df1b955d4e
parent255162e194918d1d9c3cd7c0c6d3927e3f2006bc (diff)
downloadgitlab-ce-5571-hipchat-notifications-missing-colors.tar.gz
Move color-logic into HipchatService#HipchatService5571-hipchat-notifications-missing-colors
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--app/models/project_services/hipchat_service.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/project_services/hipchat_service.rb b/app/models/project_services/hipchat_service.rb
index 4fc8d640310..d7c986c1a91 100644
--- a/app/models/project_services/hipchat_service.rb
+++ b/app/models/project_services/hipchat_service.rb
@@ -68,7 +68,7 @@ class HipchatService < Service
end
def message_options(data = nil)
- { notify: notify.present? && notify == '1', color: build_status_color(data) || color || 'yellow' }
+ { notify: notify.present? && notify == '1', color: message_color(data) }
end
def create_message(data)
@@ -240,6 +240,10 @@ class HipchatService < Service
"#{project_link}: Commit #{commit_link} of #{branch_link} #{ref_type} by #{user_name} #{humanized_status(status)} in #{duration} second(s)"
end
+ def message_color(data)
+ build_status_color(data) || color || 'yellow'
+ end
+
def build_status_color(data)
return unless data && data[:object_kind] == 'build'