From bea2831149b7f5f80894fd7c4c1147af0689050b Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 11 Apr 2023 13:55:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=9B=B4=E6=94=B9is?= =?UTF-8?q?sue=E8=AF=84=E8=AE=BA=E4=BA=8B=E4=BB=B6=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/jobs/touch_webhook_job.rb | 2 ++ app/services/api/v1/issues/journals/update_service.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/jobs/touch_webhook_job.rb b/app/jobs/touch_webhook_job.rb index 061d5ece..8319a9d6 100644 --- a/app/jobs/touch_webhook_job.rb +++ b/app/jobs/touch_webhook_job.rb @@ -52,6 +52,7 @@ class TouchWebhookJob < ApplicationJob comment = issue.comment_journals.find_by_id comment_id sender = User.find_by_id sender_id return if issue.nil? || sender.nil? + return if action_type == 'edited' && comment_json.blank? issue.project.webhooks.each do |webhook| next unless webhook.events["events"]["issue_comment"] @@ -66,6 +67,7 @@ class TouchWebhookJob < ApplicationJob sender = User.find_by_id sender_id pull = issue.try(:pull_request) return if pull.nil? || sender.nil? + return if action_type == 'edited' && comment_json.blank? pull.project.webhooks.each do |webhook| next unless webhook.events["events"]["pull_request_comment"] diff --git a/app/services/api/v1/issues/journals/update_service.rb b/app/services/api/v1/issues/journals/update_service.rb index 0b56dd30..2e27d53e 100644 --- a/app/services/api/v1/issues/journals/update_service.rb +++ b/app/services/api/v1/issues/journals/update_service.rb @@ -38,7 +38,7 @@ class Api::V1::Issues::Journals::UpdateService < ApplicationService # @信息发送 AtmeService.call(current_user, @atme_receivers, @created_journal) unless receivers_login.blank? - TouchWebhookJob.perform_later('IssueComment', @issue&.id, @current_user.id, @updated_journal.id, 'edited', @updated_journal.previous_changes.stringify_keys) + TouchWebhookJob.perform_later('IssueComment', @issue&.id, @current_user.id, @updated_journal.id, 'edited', @updated_journal.previous_changes.slice(:notes).stringify_keys) unlock("Api::V1::Issues::Journals::UpdateService:#{@issue.id}:#{@journal.id}")