Skip to content

Commit fa886ef

Browse files
authored
Merge pull request #8830 from nextcloud/node_emit_read
Emit read for nodes
2 parents 208e38e + d6b3266 commit fa886ef

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/private/Files/Node/HookConnector.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ public function viewToNode() {
7272

7373
Util::connectHook('OC_Filesystem', 'touch', $this, 'touch');
7474
Util::connectHook('OC_Filesystem', 'post_touch', $this, 'postTouch');
75+
76+
Util::connectHook('OC_Filesystem', 'read', $this, 'read');
7577
}
7678

7779
public function write($arguments) {
@@ -140,6 +142,11 @@ public function postCopy($arguments) {
140142
$this->root->emit('\OC\Files', 'postCopy', [$source, $target]);
141143
}
142144

145+
public function read($arguments) {
146+
$node = $this->getNodeForPath($arguments['path']);
147+
$this->root->emit('\OC\Files', 'read', [$node]);
148+
}
149+
143150
private function getNodeForPath($path) {
144151
$info = Filesystem::getView()->getFileInfo($path);
145152
if (!$info) {

0 commit comments

Comments
 (0)