aboutsummaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-10 23:31:59 +0800
committerUnknwon <u@gogs.io>2015-08-10 23:31:59 +0800
commitcbc7b7132f03223b3d32a97f0e54887fa682c5d6 (patch)
tree36dbff5429cac31d1178087b2b9bd155ef311a45 /models/issue.go
parent887bc1b594ef5c279c28c90009e67b068978482f (diff)
downloadgitea-cbc7b7132f03223b3d32a97f0e54887fa682c5d6.tar.gz
gitea-cbc7b7132f03223b3d32a97f0e54887fa682c5d6.zip
finish new issue action and mentions
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/models/issue.go b/models/issue.go
index 79363ce5ab..2b77597129 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -188,6 +188,22 @@ func NewIssue(repo *Repository, issue *Issue, labelIDs []int64) (err error) {
return err
}
+ // Notify watchers.
+ act := &Action{
+ ActUserID: issue.Poster.Id,
+ ActUserName: issue.Poster.Name,
+ ActEmail: issue.Poster.Email,
+ OpType: CREATE_ISSUE,
+ Content: fmt.Sprintf("%d|%s", issue.Index, issue.Name),
+ RepoID: repo.ID,
+ RepoUserName: repo.Owner.Name,
+ RepoName: repo.Name,
+ IsPrivate: repo.IsPrivate,
+ }
+ if err = notifyWatchers(sess, act); err != nil {
+ return err
+ }
+
return sess.Commit()
}
@@ -583,8 +599,8 @@ func UpdateIssueUserPairByRead(uid, iid int64) error {
return err
}
-// UpdateIssueUserPairsByMentions updates issue-user pairs by mentioning.
-func UpdateIssueUserPairsByMentions(uids []int64, iid int64) error {
+// UpdateIssueUsersByMentions updates issue-user pairs by mentioning.
+func UpdateIssueUsersByMentions(uids []int64, iid int64) error {
for _, uid := range uids {
iu := &IssueUser{UID: uid, IssueID: iid}
has, err := x.Get(iu)