Skip to content

Commit

Permalink
fix(federation): Fix conversation avatar for @all
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Mar 11, 2024
1 parent 1050fa7 commit ce7029a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/Federation/Proxy/TalkV1/UserConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use OCA\Talk\Model\Attendee;
use OCA\Talk\ResponseDefinitions;
use OCA\Talk\Room;
use OCA\Talk\Service\AvatarService;
use OCA\Talk\Service\ParticipantService;

/**
Expand All @@ -42,6 +43,7 @@ class UserConverter {

public function __construct(
protected ParticipantService $participantService,
protected AvatarService $avatarService,
) {
}

Expand Down Expand Up @@ -105,6 +107,9 @@ protected function convertMessageParameter(Room $room, array $parameter): array
$parameter['name'] = $localParticipants[$cloudId]['displayName'];
}
}
} elseif ($parameter['type'] === 'call' && $parameter['id'] === $room->getRemoteToken()) {
$parameter['id'] = $room->getToken();
$parameter['icon-url'] = $this->avatarService->getAvatarUrl($room);
}
return $parameter;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Notification/FederationChatNotifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected function isMentioned(Participant $participant, ProxyCacheMessage $mess
protected function isMentionedAll(Room $room, ProxyCacheMessage $message): bool {
foreach ($message->getParsedMessageParameters() as $parameter) {
if ($parameter['type'] === 'call' // RichObjectDefinition
&& $parameter['id'] === $room->getRemoteToken()) {
&& $parameter['id'] === $room->getToken()) {
return true;
}
}
Expand Down

0 comments on commit ce7029a

Please sign in to comment.