Adapt to new DM definition changes in the SDK (#6748)

* Set `DmRoomDefinition.TwoPeople` in `ClientBuilder`. This applies the 'direct and with at most 2 non-service members' rule to what the SDK should consider a DM.

* Map `RoomInfo.isDm` from the SDK

* Map `NotificationData.isDm` from `NotificationInfo.roomInfo.isDm`

* Remove `RoomIsDmCheck` file as its extension functions are now redundant. Move `Room.isDm` helper function to `BaseRoom`.

* Map `isDm` in `SpaceRoom` from the SDK too

* Replace `isDirect` with `isDm` where possible

* Map `RoomMember.isServiceMember` from the SDK and use it to tell apart normal members of a room from service members (i.e. `RoomMembersState.getDirectRoomMember`)
This commit is contained in:
Jorge Martin Espinosa 2026-05-11 17:22:16 +02:00 committed by GitHub
parent 5e5e0bbc6e
commit 11476c73cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 115 additions and 232 deletions

View file

@ -33,6 +33,7 @@ fun aRoomMember(
isIgnored: Boolean = false,
role: RoomMember.Role = RoomMember.Role.User,
membershipChangeReason: String? = null,
isServiceMember: Boolean = false,
) = RoomMember(
userId = userId,
displayName = displayName,
@ -43,6 +44,7 @@ fun aRoomMember(
isIgnored = isIgnored,
role = role,
membershipChangeReason = membershipChangeReason,
isServiceMember = isServiceMember,
)
fun aRoomMemberList() = persistentListOf(

View file

@ -34,6 +34,7 @@ fun aSpaceRoom(
topic: String? = null,
worldReadable: Boolean = false,
isDirect: Boolean? = null,
isDm: Boolean? = null,
via: List<String> = emptyList(),
) = SpaceRoom(
rawName = rawName,
@ -51,5 +52,6 @@ fun aSpaceRoom(
topic = topic,
worldReadable = worldReadable,
via = via.toImmutableList(),
isDirect = isDirect
isDirect = isDirect,
isDm = isDm,
)