do not send empty invite list when creating a room

This commit is contained in:
Benoit Marty 2021-07-21 20:56:08 +02:00
parent b862e5ccbf
commit 966a959e41

View file

@ -96,7 +96,7 @@ internal class CreateRoomBodyBuilder @Inject constructor(
roomAliasName = params.roomAliasName, roomAliasName = params.roomAliasName,
name = params.name, name = params.name,
topic = params.topic, topic = params.topic,
invitedUserIds = params.invitedUserIds.filter { it != userId }, invitedUserIds = params.invitedUserIds.filter { it != userId }.takeIf { it.isNotEmpty() },
invite3pids = invite3pids, invite3pids = invite3pids,
creationContent = params.creationContent.takeIf { it.isNotEmpty() }, creationContent = params.creationContent.takeIf { it.isNotEmpty() },
initialStates = initialStates, initialStates = initialStates,
@ -104,7 +104,6 @@ internal class CreateRoomBodyBuilder @Inject constructor(
isDirect = params.isDirect, isDirect = params.isDirect,
powerLevelContentOverride = params.powerLevelContentOverride, powerLevelContentOverride = params.powerLevelContentOverride,
roomVersion = params.roomVersion roomVersion = params.roomVersion
) )
} }