Skip to content

Commit

Permalink
fix: set user avatar as base64
Browse files Browse the repository at this point in the history
  • Loading branch information
rivexe committed Mar 26, 2024
1 parent 82cde5d commit f07043b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
13 changes: 0 additions & 13 deletions controller/editorapicontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,19 +448,6 @@ public function config($fileId, $filePath = null, $shareToken = null, $version =
"id" => $this->buildUserId($userId),
"name" => $user->getDisplayName()
];
$avatar = $this->avatarManager->getAvatar($userId);
if ($avatar->exists()) {
$userAvatarUrl = $this->urlGenerator->getAbsoluteURL(
$this->urlGenerator->linkToRoute(
"core.avatar.getAvatar",
[
"userId" => $userId,
"size" => 64,
]
)
);
$params["editorConfig"]["user"]["image"] = $userAvatarUrl;
}
}

$folderLink = null;
Expand Down
11 changes: 1 addition & 10 deletions controller/editorcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,16 +448,7 @@ public function userInfo($userIds) {
];
$avatar = $this->avatarManager->getAvatar($user->getUID());
if ($avatar->exists()) {
$userAvatarUrl = $this->urlGenerator->getAbsoluteURL(
$this->urlGenerator->linkToRoute(
"core.avatar.getAvatar",
[
"userId" => $user->getUID(),
"size" => 64,
]
)
);
$userData["image"] = $userAvatarUrl;
$userData["image"] = "data:image/png;base64," . $avatar->get()->__toString();
}
array_push($result, $userData);
}
Expand Down

0 comments on commit f07043b

Please sign in to comment.