Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable30] fix: Fix some minor things found by stan #13040

Merged
merged 5 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Chat/MessageParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ protected function getActorInformation(Message $message, string $actorType, stri
$actorId = MatterbridgeManager::BRIDGE_BOT_USERID;
} elseif ($actorType === Attendee::ACTOR_GUESTS
&& !in_array($actorId, [Attendee::ACTOR_ID_CLI, Attendee::ACTOR_ID_CHANGELOG], true)) {
if (isset($guestNames[$actorId])) {
if (isset($this->guestNames[$actorId])) {
$displayName = $this->guestNames[$actorId];
} else {
try {
$participant = $this->participantService->getParticipantByActor($message->getRoom(), Attendee::ACTOR_GUESTS, $actorId);
$displayName = $participant->getAttendee()->getDisplayName();
} catch (ParticipantNotFoundException $e) {
} catch (ParticipantNotFoundException) {
}
$this->guestNames[$actorId] = $displayName;
}
Expand Down
10 changes: 5 additions & 5 deletions lib/Controller/RoomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1704,13 +1704,13 @@ public function joinFederatedRoom(string $token, ?string $sessionId): DataRespon
);
}

if ($sessionId != null) {
if ($sessionId !== null) {
$participant = $this->participantService->joinRoomAsFederatedUser($room, Attendee::ACTOR_FEDERATED_USERS, $this->federationAuthenticator->getCloudId(), $sessionId);
}

$session = $participant->getSession();
if ($session instanceof Session) {
$this->sessionService->updateLastPing($session, $this->timeFactory->getTime());
$session = $participant->getSession();
if ($session instanceof Session) {
$this->sessionService->updateLastPing($session, $this->timeFactory->getTime());
}
}

// Let the clients know if they need to reload capabilities
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/BotService.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ protected function getActor(Room $room): array {
return [
'type' => Attendee::ACTOR_GUESTS,
'id' => $actorId,
'name' => $user->getDisplayName(),
'name' => '',
];
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Service/ParticipantService.php
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ public function updateCallFlags(Room $room, Participant $participant, int $flags

/**
* @param string[] $actorIds
* @param string[] $usersDirectlyMentioned
* @param string[] $actorsDirectlyMentioned
*/
public function markUsersAsMentioned(Room $room, string $actorType, array $actorIds, int $messageId, array $actorsDirectlyMentioned): void {
$update = $this->connection->getQueryBuilder();
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/RoomService.php
Original file line number Diff line number Diff line change
Expand Up @@ -894,12 +894,12 @@ public function setActiveSince(Room $room, ?Participant $participant, \DateTime
return false;
}

$details = [];
if ($room->getActiveSince() instanceof \DateTime) {
// Call is already active, just someone upgrading the call flags
$event = new BeforeRoomModifiedEvent($room, ARoomModifiedEvent::PROPERTY_IN_CALL, $callFlag, $oldCallFlag, $participant);
$this->dispatcher->dispatchTyped($event);
} else {
$details = [];
if ($silent) {
$details[AParticipantModifiedEvent::DETAIL_IN_CALL_SILENT] = true;
}
Expand Down
5 changes: 0 additions & 5 deletions tests/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
<code><![CDATA[NullCache]]></code>
</UndefinedClass>
</file>
<file src="lib/Chat/MessageParser.php">
<UndefinedVariable>
<code><![CDATA[$guestNames]]></code>
</UndefinedVariable>
</file>
<file src="lib/Chat/Parser/SystemMessage.php">
<UndefinedClass>
<code><![CDATA[\OC_Util]]></code>
Expand Down
Loading