@@ -57,6 +57,9 @@ export default {
})
message = this.$twemoji.parse(message)
return message
+ },
+ avatarUrl: function() {
+ return OC.generateUrl('/apps/social/api/v1/actor/avatar?id=' + this.item.attributedTo)
}
}
}
diff --git a/lib/Controller/LocalController.php b/lib/Controller/LocalController.php index fd80c7b2..2f36ab0d 100644 --- a/lib/Controller/LocalController.php +++ b/lib/Controller/LocalController.php @@ -46,6 +46,8 @@ use OCA\Social\Service\MiscService; use OCA\Social\Service\PostService; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\DataResponse; +use OCP\AppFramework\Http\FileDisplayResponse; +use OCP\AppFramework\Http\Response; use OCP\IRequest; @@ -410,14 +412,14 @@ class LocalController extends Controller { * @param string $id * @return DataResponse */ - public function actorAvatar(string $id): DataResponse { + public function actorAvatar(string $id): Response { try { $actor = $this->personService->getFromId($id); $avatar = $actor->getIcon(); - $this->documentService->getFromCache($avatar->getId()); + $document = $this->documentService->getFromCache($avatar->getId()); - return $this->success(['actor' => $actor]); + return new FileDisplayResponse($document); } catch (Exception $e) { return $this->fail($e); } diff --git a/src/components/TimelineEntry.vue b/src/components/TimelineEntry.vue index bb00ec0e..4d9014a0 100644 --- a/src/components/TimelineEntry.vue +++ b/src/components/TimelineEntry.vue @@ -3,7 +3,7 @@