Integration with Talk. You can save a message as a note to remind yourself.

This commit is contained in:
Matias De lellis
2022-05-26 11:24:34 -03:00
parent b6db15d8d2
commit 251e943e46
7 changed files with 97 additions and 5 deletions

View File

@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
namespace OCA\QuickNotes\Listeners;
use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\IRequest;
use OCP\Util;
class BeforeTemplateRenderedListener implements IEventListener {
private $request;
public function __construct(IRequest $request) {
$this->request = $request;
}
public function handle(Event $event): void {
if (!($event instanceof BeforeTemplateRenderedEvent)) {
return;
}
if (!$event->isLoggedIn()) {
return;
}
Util::addStyle('quicknotes', 'global');
$pathInfo = $this->request->getPathInfo();
if (strpos($pathInfo, '/call/') === 0 || strpos($pathInfo, '/apps/spreed') === 0) {
Util::addScript('quicknotes', 'quicknotes-talk');
}
}
}