summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-19 23:48:30 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-19 23:48:30 -0400
commitee92fb8635cf9f80453386f2dc4f8b3cd7e9a17e (patch)
tree05364a3705685f934b09ab80108a3b8e443f047f /models/repo.go
parent59ea3c0413723521e7504fa5b1be2c3780cbb2ea (diff)
downloadgitea-ee92fb8635cf9f80453386f2dc4f8b3cd7e9a17e.tar.gz
gitea-ee92fb8635cf9f80453386f2dc4f8b3cd7e9a17e.zip
Finish watch backend
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go
index fa6d97021b..edf800bd70 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -67,6 +67,12 @@ func GetWatches(repoId int64) ([]Watch, error) {
return watches, err
}
+// IsWatching checks if user has watched given repository.
+func IsWatching(userId, repoId int64) bool {
+ has, _ := orm.Get(&Watch{0, repoId, userId})
+ return has
+}
+
var (
gitInitLocker = sync.Mutex{}
LanguageIgns, Licenses []string