Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVitor Mattos <vitor@php.rio>2022-04-19 00:00:10 +0300
committerVitor Mattos <vitor@php.rio>2022-04-19 00:00:10 +0300
commit3737915a917c600735e160116aa62780c1f32593 (patch)
treefdab95e97d94d10fec573cc1e682f6c8513a76e2 /lib
parentd94c3c1aef2e6910292ae1584bc75a47e74801b5 (diff)
Move changelog listener annonymous function to static
Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'lib')
-rw-r--r--lib/Chat/Changelog/Listener.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Chat/Changelog/Listener.php b/lib/Chat/Changelog/Listener.php
index b534abdd0..7d31d7650 100644
--- a/lib/Chat/Changelog/Listener.php
+++ b/lib/Chat/Changelog/Listener.php
@@ -29,13 +29,7 @@ use OCP\EventDispatcher\IEventDispatcher;
class Listener {
public static function register(IEventDispatcher $dispatcher): void {
- $dispatcher->addListener(RoomController::EVENT_BEFORE_ROOMS_GET, static function (UserEvent $event) {
- $userId = $event->getUserId();
-
- /** @var Listener $listener */
- $listener = \OC::$server->get(self::class);
- $listener->preGetRooms($userId);
- }, -100);
+ $dispatcher->addListener(RoomController::EVENT_BEFORE_ROOMS_GET, [self::class, 'updateChangelog'], -100);
}
protected Manager $manager;
@@ -44,6 +38,14 @@ class Listener {
$this->manager = $manager;
}
+ public static function updateChangelog(UserEvent $event): void {
+ $userId = $event->getUserId();
+
+ /** @var Listener $listener */
+ $listener = \OC::$server->get(self::class);
+ $listener->preGetRooms($userId);
+ }
+
public function preGetRooms(string $userId): void {
if (!$this->manager->userHasNewChangelog($userId)) {
return;