public fun Channel.getOtherUsers(currentUser: User?): List<User> { val currentUserId = currentUser?.id return if (currentUserId != null) {members.filterNot { it.user.id == currentUserId }} else {members}.map { it.user } }
Returns a list of users that are members of the channel excluding the currently logged in user.