diff options
author | Andrey Nering <andrey.nering@gmail.com> | 2016-12-30 14:44:54 -0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2016-12-31 00:44:54 +0800 |
commit | 42904cb98a4b8e7accdac90bc9f06347cb0521f7 (patch) | |
tree | ff7b39817584c93ad9afd2d2136f51f5d4ddb0a0 /models/issue.go | |
parent | 37eec6c9b7056e1e05d0067aef86d2e61d67f757 (diff) | |
download | gitea-42904cb98a4b8e7accdac90bc9f06347cb0521f7.tar.gz gitea-42904cb98a4b8e7accdac90bc9f06347cb0521f7.zip |
Notification - Step 1 (#523)
* Notification - Step 1
* Add copyright headers
* Cache issue and repository on notification model
Diffstat (limited to 'models/issue.go')
-rw-r--r-- | models/issue.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/models/issue.go b/models/issue.go index 86becdbbae..6303911808 100644 --- a/models/issue.go +++ b/models/issue.go @@ -443,8 +443,16 @@ func (issue *Issue) GetAssignee() (err error) { } // ReadBy sets issue to be read by given user. -func (issue *Issue) ReadBy(uid int64) error { - return UpdateIssueUserByRead(uid, issue.ID) +func (issue *Issue) ReadBy(userID int64) error { + if err := UpdateIssueUserByRead(userID, issue.ID); err != nil { + return err + } + + if err := setNotificationStatusRead(x, userID, issue.ID); err != nil { + return err + } + + return nil } func updateIssueCols(e Engine, issue *Issue, cols ...string) error { |