Correct activity message of reopening pull request (#2420)

* Correct activity message of reopening pull request
* Fix docs
This commit is contained in:
SIkebe
2020-01-18 10:15:54 +09:00
committed by Naoki Takezoe
parent 9aee99be74
commit 564e95d36e
3 changed files with 22 additions and 2 deletions

View File

@@ -55,7 +55,7 @@ Support
- If you can't find same question and report, send it to [gitter room](https://gitter.im/gitbucket/gitbucket) before raising an issue.
- The highest priority of GitBucket is the ease of installation and API compatibility with GitHub, so your feature request might be rejected if they go against those principles.
What's New in 4.32.x
What's New in 4.33.x
-------------
### 4.33.0 - 31 Dec 2019

View File

@@ -131,6 +131,23 @@ trait ActivityService {
currentDate
)
def recordReopenPullRequestActivity(
userName: String,
repositoryName: String,
activityUserName: String,
issueId: Int,
title: String
)(implicit s: Session): Unit =
Activities insert Activity(
userName,
repositoryName,
activityUserName,
"reopen_issue",
s"[user:${activityUserName}] reopened pull request [issue:${userName}/${repositoryName}#${issueId}]",
Some(title),
currentDate
)
def recordCommentIssueActivity(
userName: String,
repositoryName: String,

View File

@@ -39,7 +39,10 @@ trait HandleCommentService {
))
case "reopen" if (issue.closed) =>
false ->
(Some("reopen") -> Some(recordReopenIssueActivity _))
(Some("reopen") -> Some(
if (issue.isPullRequest) recordReopenPullRequestActivity _
else recordReopenIssueActivity _
))
}
.map {
case (closed, t) =>