Fix emitting of legacy hook post_unshare

- When a file was unshared, the legacy hook pre_unshare fired twice and the hook post_unshare did not fire at all. This was obviously a copy-paste error.

Signed-off-by: Pauli Järvinen <pauli.jarvinen@gmail.com>
This commit is contained in:
Pauli Järvinen 2017-07-16 12:49:46 +03:00 committed by Morris Jobke
parent fad8b275f1
commit 22b29943ed
2 changed files with 2 additions and 2 deletions

View File

@ -71,7 +71,7 @@ class LegacyHooks {
$formatted['deletedShares'] = $formattedDeletedShares;
\OC_Hook::emit('OCP\Share', 'pre_unshare', $formatted);
\OC_Hook::emit('OCP\Share', 'post_unshare', $formatted);
}
private function formatHookParams(IShare $share) {

View File

@ -99,7 +99,7 @@ class LegacyHooksTest extends TestCase {
->setTarget('myTarget');
$hookListner = $this->getMockBuilder('Dummy')->setMethods(['post'])->getMock();
\OCP\Util::connectHook('OCP\Share', 'pre_unshare', $hookListner, 'post');
\OCP\Util::connectHook('OCP\Share', 'post_unshare', $hookListner, 'post');
$hookListnerExpectsPost = [
'id' => 42,