diff --git a/lib/Service/CirclesService.php b/lib/Service/CirclesService.php index 92f3c85b2..aa77365e0 100644 --- a/lib/Service/CirclesService.php +++ b/lib/Service/CirclesService.php @@ -318,6 +318,14 @@ public function settingsCircle($circleUniqueId, $settings) { $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); $this->hasToBeOwner($circle->getHigherViewer()); + $oldSettings = array_merge( + $circle->getSettings(), + [ + 'circle_name' => $circle->getName(), + 'circle_desc' => $circle->getDescription(), + ] + ); + if (!$this->viewerIsAdmin()) { $settings['members_limit'] = $circle->getSetting('members_limit'); } @@ -329,7 +337,7 @@ public function settingsCircle($circleUniqueId, $settings) { $this->circlesRequest->updateCircle($circle, $this->userId); - $this->eventsService->onSettingsChange($circle); + $this->eventsService->onSettingsChange($circle, $oldSettings); } catch (\Exception $e) { throw $e; } diff --git a/lib/Service/EventsService.php b/lib/Service/EventsService.php index 6495c2279..11502a64c 100644 --- a/lib/Service/EventsService.php +++ b/lib/Service/EventsService.php @@ -747,9 +747,10 @@ public function onLinkRemove(Circle $circle, FederatedLink $link) { * Called when the circle's settings are changed * * @param Circle $circle + * @param array $oldSettings */ - public function onSettingsChange(Circle $circle) { - $this->dispatch('\OCA\Circles::onSettingsChange', ['circle' => $circle]); + public function onSettingsChange(Circle $circle, array $oldSettings = []) { + $this->dispatch('\OCA\Circles::onSettingsChange', ['circle' => $circle, 'oldSettings' => $oldSettings]); }