diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 18:09:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-21 18:09:05 +0300 |
commit | cf6a3e7ed4cb10a3e9fcbda810601387afc8b8d6 (patch) | |
tree | bda3707e95a53cb225793fded61d5073950b0b68 /app/models | |
parent | 2a040e2655fe0a99df61ad0a7bd0c27e68af0c38 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/commit.rb | 1 | ||||
-rw-r--r-- | app/models/project_services/chat_message/base_message.rb | 2 | ||||
-rw-r--r-- | app/models/project_services/chat_message/push_message.rb | 11 | ||||
-rw-r--r-- | app/models/project_services/microsoft_teams_service.rb | 2 |
4 files changed, 5 insertions, 11 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index d8a3bbfeeb2..8068c4a07a2 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -226,6 +226,7 @@ class Commit data = { id: id, message: safe_message, + title: title, timestamp: committed_date.xmlschema, url: Gitlab::UrlBuilder.build(self), author: { diff --git a/app/models/project_services/chat_message/base_message.rb b/app/models/project_services/chat_message/base_message.rb index 5c39a80b32d..49151ad24cb 100644 --- a/app/models/project_services/chat_message/base_message.rb +++ b/app/models/project_services/chat_message/base_message.rb @@ -12,7 +12,6 @@ module ChatMessage attr_reader :user_avatar attr_reader :project_name attr_reader :project_url - attr_reader :commit_message_html def initialize(params) @markdown = params[:markdown] || false @@ -21,7 +20,6 @@ module ChatMessage @user_full_name = params.dig(:user, :name) || params[:user_full_name] @user_name = params.dig(:user, :username) || params[:user_name] @user_avatar = params.dig(:user, :avatar_url) || params[:user_avatar] - @commit_message_html = params[:commit_message_html] || false end def user_combined_name diff --git a/app/models/project_services/chat_message/push_message.rb b/app/models/project_services/chat_message/push_message.rb index 07622f570c2..41b0cbb2c4d 100644 --- a/app/models/project_services/chat_message/push_message.rb +++ b/app/models/project_services/chat_message/push_message.rb @@ -52,8 +52,7 @@ module ChatMessage end def commit_messages - linebreak_chars = commit_message_html ? "<br/>\n<br/>\n" : "\n\n" - commits.map { |commit| compose_commit_message(commit) }.join(linebreak_chars) + commits.map { |commit| compose_commit_message(commit) }.join("\n\n") end def commit_message_attachments @@ -63,15 +62,11 @@ module ChatMessage def compose_commit_message(commit) author = commit[:author][:name] id = Commit.truncate_sha(commit[:id]) - message = commit[:message] - - if commit_message_html - message = message.gsub(Gitlab::Regex.breakline_regex, "<br/>\n") - end + title = commit[:title] url = commit[:url] - "[#{id}](#{url}): #{message} - #{author}" + "[#{id}](#{url}): #{title} - #{author}" end def new_branch? diff --git a/app/models/project_services/microsoft_teams_service.rb b/app/models/project_services/microsoft_teams_service.rb index 5cabce1376b..111d010d672 100644 --- a/app/models/project_services/microsoft_teams_service.rb +++ b/app/models/project_services/microsoft_teams_service.rb @@ -58,6 +58,6 @@ class MicrosoftTeamsService < ChatNotificationService end def custom_data(data) - super(data).merge(markdown: true, commit_message_html: true) + super(data).merge(markdown: true) end end |