diff options
author | Robin Appelman <robin@icewind.nl> | 2016-12-14 16:22:33 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-01-05 09:16:03 +0100 |
commit | 84296877888ff901c1bc5a9264d44ffb915e7c56 (patch) | |
tree | ce62009cd10f98987606921ec3945160c0de1634 /apps/files_external/lib/Lib | |
parent | 6a0f0403d01dc6a889157b446edef73f9af58540 (diff) | |
download | nextcloud-server-84296877888ff901c1bc5a9264d44ffb915e7c56.tar.gz nextcloud-server-84296877888ff901c1bc5a9264d44ffb915e7c56.zip |
Update icewind/smb to 2.0.0
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external/lib/Lib')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SMB.php | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php index 4773afcb75f..7ffc078df6f 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -31,10 +31,12 @@ namespace OCA\Files_External\Lib\Storage; +use Icewind\SMB\Change; use Icewind\SMB\Exception\ConnectException; use Icewind\SMB\Exception\Exception; use Icewind\SMB\Exception\ForbiddenException; use Icewind\SMB\Exception\NotFoundException; +use Icewind\SMB\INotifyHandler; use Icewind\SMB\IFileInfo; use Icewind\SMB\IShare; use Icewind\SMB\NativeServer; @@ -486,16 +488,16 @@ class SMB extends Common implements INotifyStorage { public function listen($path, callable $callback) { $fullPath = $this->buildPath($path); $oldRenamePath = null; - $this->share->notify($fullPath, function ($smbType, $fullPath) use (&$oldRenamePath, $callback) { - $path = $this->relativePath($fullPath); + $this->share->notify($fullPath)->listen(function (Change $change) use (&$oldRenamePath, $callback) { + $path = $this->relativePath($change->getPath()); if (is_null($path)) { return true; } - if ($smbType === IShare::NOTIFY_RENAMED_OLD) { + if ($change->getCode() === INotifyHandler::NOTIFY_RENAMED_OLD) { $oldRenamePath = $path; return true; } - $type = $this->mapNotifyType($smbType); + $type = $this->mapNotifyType($change->getCode()); if (is_null($type)) { return true; } @@ -513,16 +515,16 @@ class SMB extends Common implements INotifyStorage { private function mapNotifyType($smbType) { switch ($smbType) { - case IShare::NOTIFY_ADDED: + case INotifyHandler::NOTIFY_ADDED: return INotifyStorage::NOTIFY_ADDED; - case IShare::NOTIFY_REMOVED: + case INotifyHandler::NOTIFY_REMOVED: return INotifyStorage::NOTIFY_REMOVED; - case IShare::NOTIFY_MODIFIED: - case IShare::NOTIFY_ADDED_STREAM: - case IShare::NOTIFY_MODIFIED_STREAM: - case IShare::NOTIFY_REMOVED_STREAM: + case INotifyHandler::NOTIFY_MODIFIED: + case INotifyHandler::NOTIFY_ADDED_STREAM: + case INotifyHandler::NOTIFY_MODIFIED_STREAM: + case INotifyHandler::NOTIFY_REMOVED_STREAM: return INotifyStorage::NOTIFY_MODIFIED; - case IShare::NOTIFY_RENAMED_NEW: + case INotifyHandler::NOTIFY_RENAMED_NEW: return INotifyStorage::NOTIFY_RENAMED; default: return null; |