Notification - Step 1 (#523)

* Notification - Step 1

* Add copyright headers

* Cache issue and repository on notification model
This commit is contained in:
Andrey Nering authored and Lunny Xiao committed 2016-12-31 00:44:54 +08:00
1 parent 37eec6c9b7
commit 42904cb98a
5 files changed
+349 -11

No files matched your search

+10 -2
View File
@@ -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 {