aboutsummaryrefslogtreecommitdiffstats
path: root/modules/convert
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-04-09 03:36:23 +0200
committerGitHub <noreply@github.com>2021-04-09 03:36:23 +0200
commit147826a57750f6e8120fe3bfb350cde61734969c (patch)
treec5045c42cfc6a05285e17adfef00e61c80e49d10 /modules/convert
parent9a2553920faa3c798173aa921e71cb0a256bf4c5 (diff)
downloadgitea-147826a57750f6e8120fe3bfb350cde61734969c.tar.gz
gitea-147826a57750f6e8120fe3bfb350cde61734969c.zip
[API] pull notification subject status: add "merged" (#15344)
Current subject status can be "", "open" and "closed". This add "merged" to it.
Diffstat (limited to 'modules/convert')
-rw-r--r--modules/convert/notification.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/convert/notification.go b/modules/convert/notification.go
index 49abe01253..cc941678b6 100644
--- a/modules/convert/notification.go
+++ b/modules/convert/notification.go
@@ -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{