diff options
author | Julius Knorr <jus@bitgrid.net> | 2024-12-12 15:18:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-12 15:18:47 +0100 |
commit | cba556d641d07218916e97be3e94d17cad0406fb (patch) | |
tree | b1fd40f6fa31598c83520f3367246fd9180f5c19 /apps/dav/lib/Connector | |
parent | 290c3472295c704d89a22b87d885e0eb9f523633 (diff) | |
parent | eb61a3ae4480d8d07210e91fc2037e2887f9663e (diff) | |
download | nextcloud-server-cba556d641d07218916e97be3e94d17cad0406fb.tar.gz nextcloud-server-cba556d641d07218916e97be3e94d17cad0406fb.zip |
Merge pull request #48612 from nextcloud/fix/activity-log-for-favorites-in-dav
add activity logging for favorites in dav
Diffstat (limited to 'apps/dav/lib/Connector')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/ServerFactory.php | 2 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/TagsPlugin.php | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/apps/dav/lib/Connector/Sabre/ServerFactory.php b/apps/dav/lib/Connector/Sabre/ServerFactory.php index d3837bbb920..dc6384daefe 100644 --- a/apps/dav/lib/Connector/Sabre/ServerFactory.php +++ b/apps/dav/lib/Connector/Sabre/ServerFactory.php @@ -136,7 +136,7 @@ class ServerFactory { )); if ($this->userSession->isLoggedIn()) { - $server->addPlugin(new TagsPlugin($objectTree, $this->tagManager)); + $server->addPlugin(new TagsPlugin($objectTree, $this->tagManager, $this->eventDispatcher, $this->userSession)); $server->addPlugin(new SharesPlugin( $objectTree, $this->userSession, diff --git a/apps/dav/lib/Connector/Sabre/TagsPlugin.php b/apps/dav/lib/Connector/Sabre/TagsPlugin.php index 7f05d4d3c03..eb06fa5cef6 100644 --- a/apps/dav/lib/Connector/Sabre/TagsPlugin.php +++ b/apps/dav/lib/Connector/Sabre/TagsPlugin.php @@ -27,8 +27,10 @@ namespace OCA\DAV\Connector\Sabre; * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ +use OCP\EventDispatcher\IEventDispatcher; use OCP\ITagManager; use OCP\ITags; +use OCP\IUserSession; use Sabre\DAV\PropFind; use Sabre\DAV\PropPatch; @@ -67,6 +69,8 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin { public function __construct( private \Sabre\DAV\Tree $tree, private ITagManager $tagManager, + private IEventDispatcher $eventDispatcher, + private IUserSession $userSession, ) { $this->tagger = null; $this->cachedTags = []; @@ -251,7 +255,7 @@ class TagsPlugin extends \Sabre\DAV\ServerPlugin { return true; }); - $propPatch->handle(self::FAVORITE_PROPERTYNAME, function ($favState) use ($node) { + $propPatch->handle(self::FAVORITE_PROPERTYNAME, function ($favState) use ($node, $path) { if ((int)$favState === 1 || $favState === 'true') { $this->getTagger()->tagAs($node->getId(), self::TAG_FAVORITE); } else { |