diff options
author | Rory& <root@rory.gay> | 2024-02-23 11:23:27 +0000 |
---|---|---|
committer | Rory& <root@rory.gay> | 2024-02-23 11:23:27 +0000 |
commit | 3dfb7b81b0fe19d37a7bf1183e248ca10c56277c (patch) | |
tree | 52c36b45c41e32cddd90dfcd110a393158f55675 /Tests/LibMatrix.HomeserverEmulator/Controllers/VersionsController.cs | |
parent | Apply syntax style to LibMatrix side projects (diff) | |
download | LibMatrix-3dfb7b81b0fe19d37a7bf1183e248ca10c56277c.tar.xz |
HS emulator
Diffstat (limited to 'Tests/LibMatrix.HomeserverEmulator/Controllers/VersionsController.cs')
-rw-r--r-- | Tests/LibMatrix.HomeserverEmulator/Controllers/VersionsController.cs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Tests/LibMatrix.HomeserverEmulator/Controllers/VersionsController.cs b/Tests/LibMatrix.HomeserverEmulator/Controllers/VersionsController.cs new file mode 100644 index 0000000..1349fac --- /dev/null +++ b/Tests/LibMatrix.HomeserverEmulator/Controllers/VersionsController.cs @@ -0,0 +1,48 @@ +using System.Text.Json.Nodes; +using LibMatrix.Homeservers; +using LibMatrix.Responses; +using LibMatrix.Services; +using Microsoft.AspNetCore.Mvc; + +namespace LibMatrix.HomeserverEmulator.Controllers; + +[ApiController] +[Route("/_matrix/")] +public class VersionsController(ILogger<WellKnownController> logger) : ControllerBase { + [HttpGet("client/versions")] + public async Task<ClientVersionsResponse> GetClientVersions() { + var clientVersions = new ClientVersionsResponse { + Versions = new() { + "r0.0.1", + "r0.1.0", + "r0.2.0", + "r0.3.0", + "r0.4.0", + "r0.5.0", + "r0.6.0", + "r0.6.1", + "v1.1", + "v1.2", + "v1.3", + "v1.4", + "v1.5", + "v1.6", + "v1.7", + "v1.8", + }, + UnstableFeatures = new() + }; + return clientVersions; + } + + [HttpGet("federation/v1/version")] + public async Task<ServerVersionResponse> GetServerVersions() { + var clientVersions = new ServerVersionResponse() { + Server = new() { + Name = "LibMatrix.HomeserverEmulator", + Version = "0.0.0" + } + }; + return clientVersions; + } +} \ No newline at end of file |