diff options
author | Unknwon <u@gogs.io> | 2015-08-12 18:44:09 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-12 18:44:09 +0800 |
commit | ab2d0b3b442a2dc9ad0197f6e97760f5dd6148d6 (patch) | |
tree | 3d26bdab507d7ea66f3f59e2542b1d535e48ec19 /models | |
parent | b4c0b7b98b925eb470d361d9e90d0032770513ff (diff) | |
download | gitea-ab2d0b3b442a2dc9ad0197f6e97760f5dd6148d6.tar.gz gitea-ab2d0b3b442a2dc9ad0197f6e97760f5dd6148d6.zip |
add comment form UI
Diffstat (limited to 'models')
-rw-r--r-- | models/issue.go | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/models/issue.go b/models/issue.go index cb2f03faa4..386d86ce8b 100644 --- a/models/issue.go +++ b/models/issue.go @@ -160,12 +160,9 @@ func (i *Issue) GetAssignee() (err error) { return err } -func (i *Issue) AfterDelete() { - _, err := DeleteAttachmentsByIssue(i.ID, true) - - if err != nil { - log.Info("Could not delete files for issue #%d: %s", i.ID, err) - } +// ReadBy sets issue to be read by given user. +func (i *Issue) ReadBy(uid int64) error { + return UpdateIssueUserByRead(uid, i.ID) } // CreateIssue creates new issue with labels for repository. @@ -625,10 +622,9 @@ func UpdateIssueUserByAssignee(issueID, assigneeID int64) (err error) { return sess.Commit() } -// UpdateIssueUserPairByRead updates issue-user pair for reading. -func UpdateIssueUserPairByRead(uid, iid int64) error { - rawSql := "UPDATE `issue_user` SET is_read = ? WHERE uid = ? AND issue_id = ?" - _, err := x.Exec(rawSql, true, uid, iid) +// UpdateIssueUserByRead updates issue-user relation for reading. +func UpdateIssueUserByRead(uid, issueID int64) error { + _, err := x.Exec("UPDATE `issue_user` SET is_read=? WHERE uid=? AND issue_id=?", true, uid, issueID) return err } |