mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
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:
committed by
GitHub
parent
5e5e0bbc6e
commit
11476c73cf
+2
@@ -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(
|
||||
|
||||
+3
-1
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user