2018-02-19 23:20:20 +01:00
|
|
|
// 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.
|
|
|
|
|
2020-09-29 08:33:49 +02:00
|
|
|
namespace ircd::m
|
|
|
|
{
|
|
|
|
static resource::response federation_version__get(client &, const resource::request &);
|
|
|
|
extern resource::method federation_version_get;
|
|
|
|
extern resource federation_version;
|
|
|
|
}
|
2018-02-19 23:20:20 +01:00
|
|
|
|
2020-09-29 08:33:49 +02:00
|
|
|
ircd::mapi::header
|
2018-02-19 23:20:20 +01:00
|
|
|
IRCD_MODULE
|
|
|
|
{
|
|
|
|
"Federation 2.2 :Version"
|
|
|
|
};
|
|
|
|
|
2020-09-29 08:33:49 +02:00
|
|
|
decltype(ircd::m::federation_version)
|
|
|
|
ircd::m::federation_version
|
2018-02-19 23:20:20 +01:00
|
|
|
{
|
|
|
|
"/_matrix/federation/v1/version",
|
|
|
|
{
|
|
|
|
"(2.2) Get the implementation name and version of this homeserver",
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-09-29 08:33:49 +02:00
|
|
|
decltype(ircd::m::federation_version_get)
|
|
|
|
ircd::m::federation_version_get
|
|
|
|
{
|
|
|
|
federation_version, "GET", federation_version__get
|
|
|
|
};
|
|
|
|
|
|
|
|
ircd::m::resource::response
|
|
|
|
ircd::m::federation_version__get(client &client,
|
|
|
|
const resource::request &request)
|
2018-02-19 23:20:20 +01:00
|
|
|
{
|
|
|
|
const json::members server
|
|
|
|
{
|
2020-09-29 08:33:49 +02:00
|
|
|
{ "name", ircd::info::name },
|
|
|
|
{ "version", ircd::info::version },
|
|
|
|
{ "branch", ircd::info::branch },
|
|
|
|
{ "commit", ircd::info::commit },
|
|
|
|
{ "compiler", ircd::info::compiler },
|
|
|
|
{ "kernel", ircd::info::kernel_name },
|
|
|
|
{ "arch", ircd::info::hardware::arch },
|
2018-02-19 23:20:20 +01:00
|
|
|
};
|
|
|
|
|
2019-09-29 01:12:07 +02:00
|
|
|
return m::resource::response
|
2018-02-19 23:20:20 +01:00
|
|
|
{
|
|
|
|
client, json::members
|
|
|
|
{
|
|
|
|
{ "server", server }
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|