|
1 | 1 | import gitbucket.core.controller.Context |
2 | 2 | import gitbucket.core.model.Issue |
3 | | -import gitbucket.core.service.{AccountService, IssuesService, RepositoryService} |
4 | 3 | import gitbucket.core.service.RepositoryService.RepositoryInfo |
5 | 4 | import gitbucket.core.util.Implicits.request2Session |
6 | 5 | import gitbucket.notifications._ |
7 | 6 | import gitbucket.notifications.model.Watch |
8 | | -import gitbucket.notifications.service.NotificationsService |
9 | 7 | import io.github.gitbucket.solidbase.migration.LiquibaseMigration |
10 | 8 | import io.github.gitbucket.solidbase.model.Version |
11 | 9 |
|
12 | | -class Plugin extends gitbucket.core.plugin.Plugin |
13 | | - with NotificationsService with RepositoryService with AccountService with IssuesService { |
| 10 | +class Plugin extends gitbucket.core.plugin.Plugin { |
14 | 11 |
|
15 | 12 | override val pluginId = "notifications" |
16 | 13 |
|
@@ -38,8 +35,12 @@ class Plugin extends gitbucket.core.plugin.Plugin |
38 | 35 | context.loginAccount.map { loginAccount => |
39 | 36 | implicit val session = request2Session(context.request) |
40 | 37 |
|
41 | | - html.watch(getWatch(repository.owner, repository.name, loginAccount.userName).map(_.notification) getOrElse { |
42 | | - if (autoSubscribeUsersForRepository(repository.owner, repository.name) contains loginAccount.userName) Watch.Watching else Watch.NotWatching |
| 38 | + val owner = repository.owner |
| 39 | + val name = repository.name |
| 40 | + val userName = loginAccount.userName |
| 41 | + |
| 42 | + html.watch(view.helpers.getWatch(owner, name, userName).map(_.notification) getOrElse { |
| 43 | + if (view.helpers.autoSubscribeUsersForRepository(owner, name) contains userName) Watch.Watching else Watch.NotWatching |
43 | 44 | }, repository)(context) |
44 | 45 | } |
45 | 46 | } |
|
0 commit comments