Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use OCP\EventDispatcher\GenericEvent in more places
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Dec 9, 2019
commit 1c585d2c502482624497f8e7d82a4f75f70c439c
4 changes: 3 additions & 1 deletion apps/files_external/lib/Service/BackendService.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use OCA\Files_External\Lib\Backend\Backend;
use OCA\Files_External\Lib\Config\IAuthMechanismProvider;
use OCA\Files_External\Lib\Config\IBackendProvider;
use OCP\EventDispatcher\GenericEvent;
use OCP\IConfig;

/**
Expand Down Expand Up @@ -110,7 +111,8 @@ private function callForRegistrations() {
static $eventSent = false;
if(!$eventSent) {
\OC::$server->getEventDispatcher()->dispatch(
'OCA\\Files_External::loadAdditionalBackends'
'OCA\\Files_External::loadAdditionalBackends',
new GenericEvent()
);
$eventSent = true;
}
Expand Down
3 changes: 2 additions & 1 deletion apps/files_sharing/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCA\Files\Event\LoadSidebar;
use OCP\EventDispatcher\GenericEvent;

// Check if we are a user
OCP\User::checkLoggedIn();
Expand All @@ -37,7 +38,7 @@
$tmpl->assign('showgridview', $showgridview && !$isIE);

// fire script events
$eventDispatcher->dispatch('\OCP\Collaboration\Resources::loadAdditionalScripts');
$eventDispatcher->dispatch('\OCP\Collaboration\Resources::loadAdditionalScripts', new GenericEvent());
$eventDispatcher->dispatch(LoadAdditionalScriptsEvent::class, new LoadAdditionalScriptsEvent());
$eventDispatcher->dispatch(LoadSidebar::class, new LoadSidebar());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Middleware;
use OCP\AppFramework\PublicShareController;
use OCP\EventDispatcher\GenericEvent;
use OCP\IUserSession;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

Expand All @@ -53,10 +54,10 @@ public function afterController($controller, $methodName, Response $response): R
}

if ($response instanceof TemplateResponse) {
$this->dispatcher->dispatch(TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS);
$this->dispatcher->dispatch(TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS, new GenericEvent());

if (!($response instanceof StandaloneTemplateResponse) && $this->userSession->isLoggedIn()) {
$this->dispatcher->dispatch(TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS_LOGGEDIN);
$this->dispatcher->dispatch(TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS_LOGGEDIN, new GenericEvent());
}
}

Expand Down