summaryrefslogtreecommitdiffstats
path: root/apps/comments/appinfo/app.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/comments/appinfo/app.php')
-rw-r--r--apps/comments/appinfo/app.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/comments/appinfo/app.php b/apps/comments/appinfo/app.php
index 771b35d9c6a..66e60dbbd85 100644
--- a/apps/comments/appinfo/app.php
+++ b/apps/comments/appinfo/app.php
@@ -71,3 +71,14 @@ $commentsManager->registerEventHandler(function () {
$handler = $application->getContainer()->query(\OCA\Comments\EventHandler::class);
return $handler;
});
+$commentsManager->registerDisplayNameResolver('user', function($id) {
+ $manager = \OC::$server->getUserManager();
+ $user = $manager->get($id);
+ if(is_null($user)) {
+ $l = \OC::$server->getL10N('comments');
+ $displayName = $l->t('Unknown user');
+ } else {
+ $displayName = $user->getDisplayName();
+ }
+ return $displayName;
+});