diff options
author | Vitor Mattos <vitor@php.rio> | 2023-03-20 15:17:39 -0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-04-04 17:08:49 +0200 |
commit | dfac4030a2f1b9c39d6ddd091e84e7f5758692cc (patch) | |
tree | ae24d75865d95340292752d35e2bc5efce1215d4 /lib/Notification/Notifier.php | |
parent | 557fab130dce15a841e68c4316596b2fe706ef95 (diff) |
Fix method to get avatarURL and validate the URL
https://github.com/nextcloud/spreed/pull/9072/files#r1142350857
Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'lib/Notification/Notifier.php')
-rw-r--r-- | lib/Notification/Notifier.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 1cc59b38a..f06d6cf6c 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -36,6 +36,7 @@ use OCA\Talk\Manager; use OCA\Talk\Model\Attendee; use OCA\Talk\Participant; use OCA\Talk\Room; +use OCA\Talk\Service\AvatarService; use OCA\Talk\Service\ParticipantService; use OCA\Talk\Webinary; use OCP\AppFramework\Utility\ITimeFactory; @@ -69,6 +70,7 @@ class Notifier implements INotifier { private IShareManager $shareManager; protected Manager $manager; protected ParticipantService $participantService; + protected AvatarService $avatarService; protected INotificationManager $notificationManager; protected ICommentsManager $commentManager; protected MessageParser $messageParser; @@ -92,6 +94,7 @@ class Notifier implements INotifier { IShareManager $shareManager, Manager $manager, ParticipantService $participantService, + AvatarService $avatarService, INotificationManager $notificationManager, CommentsManager $commentManager, MessageParser $messageParser, @@ -109,6 +112,7 @@ class Notifier implements INotifier { $this->shareManager = $shareManager; $this->manager = $manager; $this->participantService = $participantService; + $this->avatarService = $avatarService; $this->notificationManager = $notificationManager; $this->commentManager = $commentManager; $this->messageParser = $messageParser; @@ -322,7 +326,7 @@ class Notifier implements INotifier { 'id' => $room->getId(), 'name' => $room->getDisplayName($participant->getAttendee()->getActorId()), 'call-type' => $this->getRoomType($room), - 'icon-url' => $room->getAvatar(), + 'icon-url' => $this->avatarService->getAvatarUrl($room), ], ] ); @@ -386,7 +390,7 @@ class Notifier implements INotifier { 'id' => $room->getId(), 'name' => $room->getDisplayName($participant->getAttendee()->getActorId()), 'call-type' => $this->getRoomType($room), - 'icon-url' => $room->getAvatar(), + 'icon-url' => $this->avatarService->getAvatarUrl($room), ], 'file' => [ 'type' => 'file', @@ -483,7 +487,7 @@ class Notifier implements INotifier { 'id' => $room->getId(), 'name' => $room->getDisplayName($notification->getUser()), 'call-type' => $this->getRoomType($room), - 'icon-url' => $room->getAvatar(), + 'icon-url' => $this->avatarService->getAvatarUrl($room), ]; $messageParameters = $notification->getMessageParameters(); @@ -780,7 +784,7 @@ class Notifier implements INotifier { 'id' => $room->getId(), 'name' => $roomName, 'call-type' => $this->getRoomType($room), - 'icon-url' => $room->getAvatar(), + 'icon-url' => $this->avatarService->getAvatarUrl($room), ], ] ); @@ -806,7 +810,7 @@ class Notifier implements INotifier { 'id' => $room->getId(), 'name' => $roomName, 'call-type' => $this->getRoomType($room), - 'icon-url' => $room->getAvatar(), + 'icon-url' => $this->avatarService->getAvatarUrl($room), ], ] ); @@ -858,7 +862,7 @@ class Notifier implements INotifier { 'id' => $room->getId(), 'name' => $roomName, 'call-type' => $this->getRoomType($room), - 'icon-url' => $room->getAvatar(), + 'icon-url' => $this->avatarService->getAvatarUrl($room), ], ] ); @@ -883,7 +887,7 @@ class Notifier implements INotifier { 'id' => $room->getId(), 'name' => $roomName, 'call-type' => $this->getRoomType($room), - 'icon-url' => $room->getAvatar(), + 'icon-url' => $this->avatarService->getAvatarUrl($room), ], ] ); |