0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-25 05:18:23 +02:00
construct/modules/federation/version.cc

52 lines
1 KiB
C++

// Matrix Construct
//
// Copyright (C) Matrix Construct Developers, Authors & Contributors
// Copyright (C) 2016-2018 Jason Volk <jason@zemos.net>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
using namespace ircd;
mapi::header
IRCD_MODULE
{
"Federation 2.2 :Version"
};
m::resource
version_resource
{
"/_matrix/federation/v1/version",
{
"(2.2) Get the implementation name and version of this homeserver",
}
};
m::resource::response
get__version(client &client,
const m::resource::request &request)
{
const json::members server
{
{ "name", ircd::info::name },
{ "version", ircd::info::version },
};
return m::resource::response
{
client, json::members
{
{ "server", server }
}
};
}
m::resource::method
method_get
{
version_resource, "GET", get__version
};