From db1c3f7f4eb7355c905c06bf44b3d2fec971f46c Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 8 Apr 2021 11:43:49 +0200 Subject: [PATCH 1/2] API: pull notification subject status: add "merged" --- modules/convert/notification.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/convert/notification.go b/modules/convert/notification.go index 49abe01253246..112c8727213c7 100644 --- a/modules/convert/notification.go +++ b/modules/convert/notification.go @@ -47,6 +47,13 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread { if err == nil && comment != nil { result.Subject.LatestCommentURL = comment.APIURL() } + + pr, _ := n.Issue.GetPullRequest() + if pr != nil { + if pr.HasMerged { + result.Subject.State = "merged" + } + } } case models.NotificationSourceCommit: result.Subject = &api.NotificationSubject{ From 190abf784e7570772f6aa547d21d8b2d7b0c4c73 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Thu, 8 Apr 2021 15:53:25 +0200 Subject: [PATCH 2/2] Update modules/convert/notification.go Co-authored-by: a1012112796 <1012112796@qq.com> --- modules/convert/notification.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/convert/notification.go b/modules/convert/notification.go index 112c8727213c7..cc941678b6038 100644 --- a/modules/convert/notification.go +++ b/modules/convert/notification.go @@ -49,10 +49,8 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread { } pr, _ := n.Issue.GetPullRequest() - if pr != nil { - if pr.HasMerged { - result.Subject.State = "merged" - } + if pr != nil && pr.HasMerged { + result.Subject.State = "merged" } } case models.NotificationSourceCommit: