Improve createRoomThreePidEvents for clarity
This commit is contained in:
parent
eab4ebc3b1
commit
cac4df7d66
@ -156,7 +156,7 @@ internal class DefaultCreateLocalRoomStateEventsTask @Inject constructor(
|
|||||||
* Generate the local state events related to the given third party invites, if any.
|
* Generate the local state events related to the given third party invites, if any.
|
||||||
*/
|
*/
|
||||||
private fun MutableList<Event>.createRoomThreePidEvents() {
|
private fun MutableList<Event>.createRoomThreePidEvents() {
|
||||||
val threePidEvents = createRoomBody.invite3pids.orEmpty().map { body ->
|
createRoomBody.invite3pids.orEmpty().forEach { body ->
|
||||||
val localThirdPartyInviteEvent = createLocalStateEvent(
|
val localThirdPartyInviteEvent = createLocalStateEvent(
|
||||||
type = EventType.LOCAL_STATE_ROOM_THIRD_PARTY_INVITE,
|
type = EventType.LOCAL_STATE_ROOM_THIRD_PARTY_INVITE,
|
||||||
content = LocalRoomThirdPartyInviteContent(
|
content = LocalRoomThirdPartyInviteContent(
|
||||||
@ -168,11 +168,16 @@ internal class DefaultCreateLocalRoomStateEventsTask @Inject constructor(
|
|||||||
)
|
)
|
||||||
val thirdPartyInviteEvent = createLocalStateEvent(
|
val thirdPartyInviteEvent = createLocalStateEvent(
|
||||||
type = EventType.STATE_ROOM_THIRD_PARTY_INVITE,
|
type = EventType.STATE_ROOM_THIRD_PARTY_INVITE,
|
||||||
content = RoomThirdPartyInviteContent(body.address, null, null, null).toContent(),
|
content = RoomThirdPartyInviteContent(
|
||||||
|
displayName = body.address,
|
||||||
|
keyValidityUrl = null,
|
||||||
|
publicKey = null,
|
||||||
|
publicKeys = null
|
||||||
|
).toContent(),
|
||||||
)
|
)
|
||||||
listOf(localThirdPartyInviteEvent, thirdPartyInviteEvent)
|
add(localThirdPartyInviteEvent)
|
||||||
}.flatten()
|
add(thirdPartyInviteEvent)
|
||||||
addAll(threePidEvents)
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user