summaryrefslogtreecommitdiffstats
path: root/models/issue_watch.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/issue_watch.go')
-rw-r--r--models/issue_watch.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/models/issue_watch.go b/models/issue_watch.go
index 69e218af01..3e7d24821b 100644
--- a/models/issue_watch.go
+++ b/models/issue_watch.go
@@ -71,3 +71,15 @@ func getIssueWatchers(e Engine, issueID int64) (watches []*IssueWatch, err error
Find(&watches)
return
}
+
+func removeIssueWatchersByRepoID(e Engine, userID int64, repoID int64) error {
+ iw := &IssueWatch{
+ IsWatching: false,
+ }
+ _, err := e.
+ Join("INNER", "issue", "`issue`.id = `issue_watch`.issue_id AND `issue`.repo_id = ?", repoID).
+ Cols("is_watching", "updated_unix").
+ Where("`issue_watch`.user_id = ?", userID).
+ Update(iw)
+ return err
+}