Wire local room logic (#9078)

* Wire local room logic

* Migrate to testling-lib; update test descriptions
This commit is contained in:
Michael Weimann
2022-07-20 09:26:25 +02:00
committed by GitHub
parent 66f7c9f564
commit fa1bff67cf
14 changed files with 494 additions and 12 deletions
+7 -1
View File
@@ -22,6 +22,7 @@ import { split } from "lodash";
import DMRoomMap from './utils/DMRoomMap';
import { mediaFromMxc } from "./customisations/Media";
import { isLocalRoom } from "./utils/localRoom/isLocalRoom";
// Not to be used for BaseAvatar urls as that has similar default avatar fallback already
export function avatarUrlForMember(
@@ -142,7 +143,12 @@ export function avatarUrlForRoom(room: Room, width: number, height: number, resi
if (room.isSpaceRoom()) return null;
// If the room is not a DM don't fallback to a member avatar
if (!DMRoomMap.shared().getUserIdForRoomId(room.roomId)) return null;
if (
!DMRoomMap.shared().getUserIdForRoomId(room.roomId)
&& !(isLocalRoom(room))
) {
return null;
}
// If there are only two members in the DM use the avatar of the other member
const otherMember = room.getAvatarFallbackMember();