diff --git a/servers-service/src/main/kotlin/piperkt/services/servers/application/ChannelService.kt b/servers-service/src/main/kotlin/piperkt/services/servers/application/ChannelService.kt index 73049fd2d..ebf715a30 100644 --- a/servers-service/src/main/kotlin/piperkt/services/servers/application/ChannelService.kt +++ b/servers-service/src/main/kotlin/piperkt/services/servers/application/ChannelService.kt @@ -138,8 +138,8 @@ open class ChannelService( return Result.success( ChannelQuery.GetMessagesFromChannelId.Response( channel.messages.subList( - request.from, - request.limit.coerceAtMost(channel.messages.size) + request.from.coerceAtMost(channel.messages.size), + (request.from + request.limit).coerceAtMost(channel.messages.size) ) ) )