diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2021-10-27 16:58:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-27 16:58:13 +0300 |
commit | 76a52e04b6cee32049385e29cc3b80dad6f0e8d8 (patch) | |
tree | 02aa4876ead20d76fcaedc82e431f5f8b296fc1d /lib | |
parent | 8a70d1a2a9bfaad079e483ce68ce609d8a6c9158 (diff) | |
parent | a4972f3f6452726c678d9eb11cacc75a15f667ce (diff) |
Merge pull request #6419 from nextcloud/feature/noid/limit-grid-size
Limit grid size to boost performance
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Config.php | 8 | ||||
-rw-r--r-- | lib/TInitialState.php | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/Config.php b/lib/Config.php index 8e0133a85..6780185c7 100644 --- a/lib/Config.php +++ b/lib/Config.php @@ -393,4 +393,12 @@ class Config { $hash = hash_hmac('sha256', $data, $secret); return hash_equals($hash, substr($ticket, $lastColon + 1)); } + + public function getGridVideosLimit(): int { + return (int) $this->config->getAppValue('spreed', 'grid_videos_limit', '19'); // 5*4 - self + } + + public function getGridVideosLimitEnforced(): bool { + return $this->config->getAppValue('spreed', 'grid_videos_limit_enforced', 'no') === 'yes'; + } } diff --git a/lib/TInitialState.php b/lib/TInitialState.php index 4ad6750ee..05229adad 100644 --- a/lib/TInitialState.php +++ b/lib/TInitialState.php @@ -72,6 +72,16 @@ trait TInitialState { 'sip_dialin_info', $this->talkConfig->getDialInInfo() ); + + $this->initialState->provideInitialState( + 'grid_videos_limit', + $this->talkConfig->getGridVideosLimit() + ); + + $this->initialState->provideInitialState( + 'grid_videos_limit_enforced', + $this->talkConfig->getGridVideosLimitEnforced() + ); } protected function publishInitialStateForUser(IUser $user, IRootFolder $rootFolder, IAppManager $appManager): void { |