summaryrefslogtreecommitdiffstats
path: root/apps/comments
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2016-02-24 13:23:44 +0100
committerJoas Schilling <nickvergessen@owncloud.com>2016-05-23 09:03:48 +0200
commitc9fda848411d3369d39201a4ebcf8505fb70adce (patch)
tree55a2a7a4a5a83cdef579910d04ad2665d41d4fd3 /apps/comments
parent3a8e537946363dcbcfe07ead5e8979aef5fafcd9 (diff)
downloadnextcloud-server-c9fda848411d3369d39201a4ebcf8505fb70adce.tar.gz
nextcloud-server-c9fda848411d3369d39201a4ebcf8505fb70adce.zip
Make the root collection neutral so it does not only work for files
Diffstat (limited to 'apps/comments')
-rw-r--r--apps/comments/appinfo/app.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/comments/appinfo/app.php b/apps/comments/appinfo/app.php
index cd1ccb2d7d3..b060a5db1ca 100644
--- a/apps/comments/appinfo/app.php
+++ b/apps/comments/appinfo/app.php
@@ -51,3 +51,10 @@ $managerListener = function(\OCP\Comments\CommentsEvent $event) use ($activityMa
};
$eventDispatcher->addListener(\OCP\Comments\CommentsEvent::EVENT_ADD, $managerListener);
+
+$eventDispatcher->addListener(\OCP\Comments\CommentsEntityEvent::EVENT_ENTITY, function(\OCP\Comments\CommentsEntityEvent $event) {
+ $event->addEntityCollection('files', function($name) {
+ $nodes = \OC::$server->getUserFolder()->getById(intval($name));
+ return !empty($nodes);
+ });
+});