mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-30 06:38:37 -04:00 
			
		
		
		
	Notifying on open PR, and Close/Reopen/Merge issue or PR
This commit is contained in:
		| @@ -875,6 +875,8 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) { | |||||||
| 					log.Error(4, "ChangeStatus: %v", err) | 					log.Error(4, "ChangeStatus: %v", err) | ||||||
| 				} else { | 				} else { | ||||||
| 					log.Trace("Issue [%d] status changed to closed: %v", issue.ID, issue.IsClosed) | 					log.Trace("Issue [%d] status changed to closed: %v", issue.ID, issue.IsClosed) | ||||||
|  |  | ||||||
|  | 					notification.Service.NotifyIssue(issue, ctx.User.ID) | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|   | |||||||
| @@ -16,7 +16,9 @@ import ( | |||||||
| 	"code.gitea.io/gitea/modules/base" | 	"code.gitea.io/gitea/modules/base" | ||||||
| 	"code.gitea.io/gitea/modules/context" | 	"code.gitea.io/gitea/modules/context" | ||||||
| 	"code.gitea.io/gitea/modules/log" | 	"code.gitea.io/gitea/modules/log" | ||||||
|  | 	"code.gitea.io/gitea/modules/notification" | ||||||
| 	"code.gitea.io/gitea/modules/setting" | 	"code.gitea.io/gitea/modules/setting" | ||||||
|  |  | ||||||
| 	"github.com/Unknwon/com" | 	"github.com/Unknwon/com" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| @@ -415,6 +417,8 @@ func MergePullRequest(ctx *context.Context) { | |||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	notification.Service.NotifyIssue(pr.Issue, ctx.User.ID) | ||||||
|  |  | ||||||
| 	log.Trace("Pull request merged: %d", pr.ID) | 	log.Trace("Pull request merged: %d", pr.ID) | ||||||
| 	ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + com.ToStr(pr.Index)) | 	ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + com.ToStr(pr.Index)) | ||||||
| } | } | ||||||
| @@ -707,6 +711,8 @@ func CompareAndPullRequestPost(ctx *context.Context, form auth.CreateIssueForm) | |||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	notification.Service.NotifyIssue(pullIssue, ctx.User.ID) | ||||||
|  |  | ||||||
| 	log.Trace("Pull request created: %d/%d", repo.ID, pullIssue.ID) | 	log.Trace("Pull request created: %d/%d", repo.ID, pullIssue.ID) | ||||||
| 	ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + com.ToStr(pullIssue.Index)) | 	ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + com.ToStr(pullIssue.Index)) | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user