Fix incorrect HasPassword value for returned rooms

This commit is contained in:
Dan Balasescu 2022-06-03 21:17:47 +09:00
parent 06ac3c1ad3
commit 3df4d1b0e6
1 changed files with 6 additions and 0 deletions

View File

@ -179,9 +179,15 @@ public void AddServerSideRoom(Room room, APIUser host)
private Room createResponseRoom(Room room, bool withParticipants)
{
var responseRoom = cloneRoom(room);
// Password is hidden from the response, and is only propagated via HasPassword.
bool hadPassword = responseRoom.HasPassword.Value;
responseRoom.Password.Value = null;
responseRoom.HasPassword.Value = hadPassword;
if (!withParticipants)
responseRoom.RecentParticipants.Clear();
return responseRoom;
}