isAbandonedDMRoom property

bool get isAbandonedDMRoom

Checks if this is an abandoned DM room where the other participant has left the room. This is false when there are still other users in the room or the room is not marked as a DM room.

Implementation

bool get isAbandonedDMRoom {
  final directChatMatrixID = this.directChatMatrixID;

  if (directChatMatrixID == null) return false;
  final dmPartnerMembership = unsafeGetUserFromMemoryOrFallback(
    directChatMatrixID,
  ).membership;
  return dmPartnerMembership == Membership.leave &&
      summary.mJoinedMemberCount == 1 &&
      summary.mInvitedMemberCount == 0;
}