Emit read for nodes
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
23a02eaf14
commit
d6b326650b
|
@ -72,6 +72,8 @@ class HookConnector {
|
||||||
|
|
||||||
Util::connectHook('OC_Filesystem', 'touch', $this, 'touch');
|
Util::connectHook('OC_Filesystem', 'touch', $this, 'touch');
|
||||||
Util::connectHook('OC_Filesystem', 'post_touch', $this, 'postTouch');
|
Util::connectHook('OC_Filesystem', 'post_touch', $this, 'postTouch');
|
||||||
|
|
||||||
|
Util::connectHook('OC_Filesystem', 'read', $this, 'read');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function write($arguments) {
|
public function write($arguments) {
|
||||||
|
@ -140,6 +142,11 @@ class HookConnector {
|
||||||
$this->root->emit('\OC\Files', 'postCopy', [$source, $target]);
|
$this->root->emit('\OC\Files', 'postCopy', [$source, $target]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function read($arguments) {
|
||||||
|
$node = $this->getNodeForPath($arguments['path']);
|
||||||
|
$this->root->emit('\OC\Files', 'read', [$node]);
|
||||||
|
}
|
||||||
|
|
||||||
private function getNodeForPath($path) {
|
private function getNodeForPath($path) {
|
||||||
$info = Filesystem::getView()->getFileInfo($path);
|
$info = Filesystem::getView()->getFileInfo($path);
|
||||||
if (!$info) {
|
if (!$info) {
|
||||||
|
|
Loading…
Reference in New Issue