]> source.dussan.org Git - nextcloud-server.git/commitdiff
add post hooks to share API, needed by the encryption app
authorBjörn Schießle <schiessle@owncloud.com>
Fri, 24 May 2013 11:15:51 +0000 (13:15 +0200)
committerBjörn Schießle <schiessle@owncloud.com>
Fri, 24 May 2013 11:15:51 +0000 (13:15 +0200)
lib/public/share.php

index dbe3c7193e4293be26607decff692f65d26f157f..7cebf654639fd82a982a002f9d0d8f81e781cc5a 100644 (file)
@@ -515,8 +515,16 @@ class Share {
                                'fileSource' => $item['file_source'],
                                'shareType' => $shareType,
                                'shareWith' => $shareWith,
+                               'itemParent' => $item['parent'],
                        ));
                        self::delete($item['id']);
+                       \OC_Hook::emit('OCP\Share', 'post_unshare', array(
+                               'itemType' => $itemType,
+                               'itemSource' => $itemSource,
+                               'shareType' => $shareType,
+                               'shareWith' => $shareWith,
+                               'itemParent' => $item['parent'],
+                       ));
                        return true;
                }
                return false;
@@ -539,6 +547,11 @@ class Share {
                        foreach ($shares as $share) {
                                self::delete($share['id']);
                        }
+                       \OC_Hook::emit('OCP\Share', 'post_unshareAll', array(
+                               'itemType' => $itemType,
+                               'itemSource' => $itemSource,
+                               'shares' => $shares
+                       ));
                        return true;
                }
                return false;