From ff22f83871bbe41574021c5392d68547a7dfb26b Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 21 May 2021 09:19:42 +0200 Subject: [PATCH] wip #4472 @0.5 --- .idea/deployment.xml | 10 +++++++++- .idea/misc.xml | 3 +++ lib/redmine_slack/patches/issue_patch.rb | 20 ++++++++++---------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.idea/deployment.xml b/.idea/deployment.xml index 4d7d1a3..1b31e23 100644 --- a/.idea/deployment.xml +++ b/.idea/deployment.xml @@ -1,6 +1,6 @@ - + @@ -9,6 +9,13 @@ + + + + + + + @@ -339,5 +346,6 @@ + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 0a76216..b658e95 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,8 @@ + + diff --git a/lib/redmine_slack/patches/issue_patch.rb b/lib/redmine_slack/patches/issue_patch.rb index 86dcbda..4621592 100644 --- a/lib/redmine_slack/patches/issue_patch.rb +++ b/lib/redmine_slack/patches/issue_patch.rb @@ -67,13 +67,13 @@ module RedmineSlack def send_redmine_slack_update #return if current_journal.nil? - # return if RequestStore.store[:redmine_slack_silent].nil? + return if RequestStore.store[:redmine_slack_silent].nil? channels = Slack.channels_for_project project - #return unless channels.present? && Slack.setting_for_project(project, :post_updates) - #return if is_private? && !Slack.setting_for_project(project, :post_private_issues) - #return if current_journal.private_notes? && !Slack.setting_for_project(project, :post_private_notes) + return unless channels.present? && Slack.setting_for_project(project, :post_updates) + return if is_private? && !Slack.setting_for_project(project, :post_private_issues) + return if current_journal.private_notes? && !Slack.setting_for_project(project, :post_private_notes) set_language_if_valid Setting.default_language @@ -140,12 +140,12 @@ module RedmineSlack attachment[:fields] = fields if fields.any? - # send_message = true - # if Slack.setting_for_project(project, :supress_empty_messages) - # send_message = false unless (attachment.any? && attachment.key?(:text)) || !text_diff.empty? - # end - # - # return unless send_message + send_message = true + if Slack.setting_for_project(project, :supress_empty_messages) + send_message = false unless (attachment.any? && attachment.key?(:text)) || !text_diff.empty? + end + + return unless send_message attachment[:color] = Slack.textfield_for_project(project, :color_update_notifications) -- 2.39.5