Skip to content

Commit

Permalink
fix(CI): Fix psalm and phpunit - I shall never force merge
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Feb 29, 2024
1 parent a91b44b commit b941660
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions lib/Chat/Parser/SystemMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -825,12 +825,18 @@ protected function getFileFromShare(?Participant $participant, string $shareId):
}

protected function isCurrentParticipantChangedUser(?string $currentActorType, ?string $currentActorId, array $parameter): bool {
if (isset($parameter['server']) && $currentActorType === Attendee::ACTOR_FEDERATED_USERS) {
if ($currentActorType === Attendee::ACTOR_GUESTS) {
return $parameter['type'] === 'guest' && $currentActorId === $parameter['id'];
}

if (isset($parameter['server'])
&& $currentActorType === Attendee::ACTOR_FEDERATED_USERS
&& $parameter['type'] === 'user') {
return $this->currentFederatedUserDetails['user'] === $parameter['id']
&& $this->currentFederatedUserDetails['server'] === $parameter['server'];
}

return $currentActorType === Attendee::ACTOR_USERS && $currentActorId === $parameter['id'];
return $currentActorType === Attendee::ACTOR_USERS && $parameter['type'] === 'user' && $currentActorId === $parameter['id'];
}

protected function getActorFromComment(Room $room, IComment $comment): array {
Expand Down
2 changes: 1 addition & 1 deletion lib/Federation/Proxy/TalkV1/UserConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ protected function convertMessageParameters(Room $room, array $message): array {
* @return TalkChatMessageWithParent
*/
public function convertMessage(Room $room, array $message): array {
$message['token'] = $room->getToken();
$message = $this->convertAttendee($room, $message, 'actorType', 'actorId', 'actorDisplayName');
$message = $this->convertAttendee($room, $message, 'lastEditActorType', 'lastEditActorId', 'lastEditActorDisplayName');
$message = $this->convertMessageParameters($room, $message);
$message['token'] = $room->getToken();

if (isset($message['parent'])) {
$message['parent'] = $this->convertMessage($room, $message['parent']);
Expand Down

0 comments on commit b941660

Please sign in to comment.