aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CardDAV/Activity
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2022-08-19 12:28:44 +0200
committerGitHub <noreply@github.com>2022-08-19 12:28:44 +0200
commit71065f5fd5f75b5847795eb0df916c12a7dfc07d (patch)
tree8c226708224f0d07121baec337fa898fc9e71ee5 /apps/dav/lib/CardDAV/Activity
parent7d7f7abf7fb3f7ea8e5382a101b8246021de0bbf (diff)
parent7e1177819023a185480b5251e3a22dc429948518 (diff)
downloadnextcloud-server-71065f5fd5f75b5847795eb0df916c12a7dfc07d.tar.gz
nextcloud-server-71065f5fd5f75b5847795eb0df916c12a7dfc07d.zip
Merge pull request #33615 from nextcloud/perf/noid/user-displayname-cache-for-activity-providers
Use user name cache in activity providers
Diffstat (limited to 'apps/dav/lib/CardDAV/Activity')
-rw-r--r--apps/dav/lib/CardDAV/Activity/Provider/Base.php22
1 files changed, 1 insertions, 21 deletions
diff --git a/apps/dav/lib/CardDAV/Activity/Provider/Base.php b/apps/dav/lib/CardDAV/Activity/Provider/Base.php
index 2f6de31de15..3e7a966c08a 100644
--- a/apps/dav/lib/CardDAV/Activity/Provider/Base.php
+++ b/apps/dav/lib/CardDAV/Activity/Provider/Base.php
@@ -98,35 +98,15 @@ abstract class Base implements IProvider {
];
}
- /**
- * @param string $uid
- * @return array
- */
protected function generateUserParameter(string $uid): array {
- if (!isset($this->userDisplayNames[$uid])) {
- $this->userDisplayNames[$uid] = $this->getUserDisplayName($uid);
- }
-
return [
'type' => 'user',
'id' => $uid,
- 'name' => $this->userDisplayNames[$uid],
+ 'name' => $this->userManager->getDisplayName($uid) ?? $uid,
];
}
/**
- * @param string $uid
- * @return string
- */
- protected function getUserDisplayName(string $uid): string {
- $user = $this->userManager->get($uid);
- if ($user instanceof IUser) {
- return $user->getDisplayName();
- }
- return $uid;
- }
-
- /**
* @param string $gid
* @return array
*/