change(invites) : add logic to decline invite and block a user

This commit is contained in:
ganfra 2025-02-27 21:09:47 +01:00
parent e2116e76f2
commit 82dc29b91c
13 changed files with 145 additions and 63 deletions

View file

@ -329,9 +329,12 @@ class RoomListPresenter @Inject constructor(
}
@VisibleForTesting
internal fun RoomListRoomSummary.toInviteData() = InviteData(
roomId = roomId,
// Note: `name` should not be null at this point, but just in case, fallback to the roomId
roomName = name ?: roomId.value,
isDm = isDm,
)
internal fun RoomListRoomSummary.toInviteData(): InviteData? {
if (inviteSender == null) return null
return InviteData(
roomId = roomId,
roomName = name ?: roomId.value,
isDm = isDm,
senderId = inviteSender.userId,
)
}