diff --git a/lib/Model/ShareWrapper.php b/lib/Model/ShareWrapper.php index 75472dd9f..f6173dcd5 100644 --- a/lib/Model/ShareWrapper.php +++ b/lib/Model/ShareWrapper.php @@ -402,7 +402,12 @@ public function getShare( $share->setTarget($this->getFileTarget()); $share->setProviderId($this->getProviderId()); $share->setStatus($this->getStatus()); - $share->setToken($this->getToken()); + // use oc_circles_token.token instead of oc_share.token when available + if ($this->hasShareToken() && $this->getShareToken()->token !== '') { + $share->setToken($this->getShareToken()->token); + } else { + $share->setToken($this->getToken()); + } if ($this->getExpirationDate() !== null) { $share->setExpirationDate($this->getExpirationDate()); }