]> source.dussan.org Git - nextcloud-server.git/commitdiff
Extract unshare() code into unshareItem().
authorAndreas Fischer <bantu@owncloud.com>
Mon, 23 Sep 2013 14:43:08 +0000 (16:43 +0200)
committerMorris Jobke <morris.jobke@gmail.com>
Sun, 3 Nov 2013 11:33:34 +0000 (12:33 +0100)
lib/public/share.php

index a8d1436e10084a804e6680428cb1b64b6b4d8a3b..2d56ea7220cbc24f5b054112625f3903d138ca28 100644 (file)
@@ -634,23 +634,7 @@ class Share {
        public static function unshare($itemType, $itemSource, $shareType, $shareWith) {
                if ($item = self::getItems($itemType, $itemSource, $shareType, $shareWith, \OC_User::getUser(),
                        self::FORMAT_NONE, null, 1)) {
-                       // Pass all the vars we have for now, they may be useful
-                       \OC_Hook::emit('OCP\Share', 'pre_unshare', array(
-                               'itemType' => $itemType,
-                               'itemSource' => $itemSource,
-                               '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'],
-                       ));
+                       self::unshareItem($item);
                        return true;
                }
                return false;