aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-12 18:44:09 +0800
committerUnknwon <u@gogs.io>2015-08-12 18:44:09 +0800
commitab2d0b3b442a2dc9ad0197f6e97760f5dd6148d6 (patch)
tree3d26bdab507d7ea66f3f59e2542b1d535e48ec19 /models
parentb4c0b7b98b925eb470d361d9e90d0032770513ff (diff)
downloadgitea-ab2d0b3b442a2dc9ad0197f6e97760f5dd6148d6.tar.gz
gitea-ab2d0b3b442a2dc9ad0197f6e97760f5dd6148d6.zip
add comment form UI
Diffstat (limited to 'models')
-rw-r--r--models/issue.go16
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
}