]> source.dussan.org Git - gitea.git/commitdiff
[API] pull notification subject status: add "merged" (#15344) (#15654)
author6543 <6543@obermui.de>
Wed, 28 Apr 2021 19:24:56 +0000 (21:24 +0200)
committerGitHub <noreply@github.com>
Wed, 28 Apr 2021 19:24:56 +0000 (20:24 +0100)
Current subject status can be "", "open" and "closed". This add "merged" to it.

modules/convert/notification.go

index 49abe01253246e1dae9f1eecdc8e3e7d84cd9429..cc941678b60382cc5d4963544fc953aa794ed9d2 100644 (file)
@@ -47,6 +47,11 @@ func ToNotificationThread(n *models.Notification) *api.NotificationThread {
                        if err == nil && comment != nil {
                                result.Subject.LatestCommentURL = comment.APIURL()
                        }
+
+                       pr, _ := n.Issue.GetPullRequest()
+                       if pr != nil && pr.HasMerged {
+                               result.Subject.State = "merged"
+                       }
                }
        case models.NotificationSourceCommit:
                result.Subject = &api.NotificationSubject{