Wire local room logic (#9078)
* Wire local room logic * Migrate to testling-lib; update test descriptions
This commit is contained in:
+7
-1
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user