summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2016-11-18 11:21:45 +0100
committerRobin Appelman <robin@icewind.nl>2016-11-18 11:26:00 +0100
commitdbd7f6dea61982f34d3005ac2ad63f0cd3ff9be8 (patch)
tree5683cb2066a0bc60a3f413ad13cbd57c60548ce8 /apps
parent02bfd915534d5dfaee3c5c873b84cc14657bed15 (diff)
downloadnextcloud-server-dbd7f6dea61982f34d3005ac2ad63f0cd3ff9be8.tar.gz
nextcloud-server-dbd7f6dea61982f34d3005ac2ad63f0cd3ff9be8.zip
cache the displayname of the share owner
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/Cache.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php
index 21f3ff622f9..038be1c3fea 100644
--- a/apps/files_sharing/lib/Cache.php
+++ b/apps/files_sharing/lib/Cache.php
@@ -59,6 +59,8 @@ class Cache extends CacheJail {
private $rootUnchanged = true;
+ private $ownerDisplayName;
+
/**
* @param \OCA\Files_Sharing\SharedStorage $storage
* @param IStorage $sourceStorage
@@ -120,13 +122,20 @@ class Cache extends CacheJail {
$entry['permissions'] = $sharePermissions;
}
$entry['uid_owner'] = $this->storage->getOwner($path);
- $entry['displayname_owner'] = \OC_User::getDisplayName($entry['uid_owner']);
+ $entry['displayname_owner'] = $this->getOwnerDisplayName();
if ($path === '') {
$entry['is_share_mount_point'] = true;
}
return $entry;
}
+ private function getOwnerDisplayName() {
+ if (!$this->ownerDisplayName) {
+ $this->ownerDisplayName = \OC_User::getDisplayName($this->storage->getOwner(''));
+ }
+ return $this->ownerDisplayName;
+ }
+
/**
* remove all entries for files that are stored on the storage from the cache
*/