Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
fix automatic DM avatar with functional members
Browse files Browse the repository at this point in the history
  • Loading branch information
HarHarLinks committed Jan 19, 2024
1 parent b3ab5fc commit 52da061
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/views/avatars/DecoratedRoomAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { MatrixClientPeg } from "../../../MatrixClientPeg";
import { _t } from "../../../languageHandler";
import DMRoomMap from "../../../utils/DMRoomMap";
import { IOOBData } from "../../../stores/ThreepidInviteStore";
import { getJoinedNonFunctionalMembers } from "../../../utils/room/getJoinedNonFunctionalMembers";

interface IProps {
room: Room;
Expand Down Expand Up @@ -158,7 +159,7 @@ export default class DecoratedRoomAvatar extends React.PureComponent<IProps, ISt

// We look at the DMRoomMap and not the tag here so that we don't exclude DMs in Favourites
const otherUserId = DMRoomMap.shared().getUserIdForRoomId(this.props.room.roomId);
if (otherUserId && this.props.room.getJoinedMemberCount() === 2) {
if (otherUserId && getJoinedNonFunctionalMembers(this.props.room).length === 2) {
// Track presence, if available
if (isPresenceEnabled(this.props.room.client)) {
this.dmUser = MatrixClientPeg.safeGet().getUser(otherUserId);
Expand Down

0 comments on commit 52da061

Please sign in to comment.