0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-16 07:28:38 +02:00
construct/modules/client/pushrules.cc
Jason Volk 5f24883c1c modules: Add minimum viable stubs for errorless Riot load.
modules/client/pushrules: Stub arrays for errorless Riot load.
2018-02-12 19:30:44 -08:00

61 lines
1.4 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;
static const auto description
{R"(
Retrieve all push rulesets for this user. Clients can "drill-down" on the rulesets by
suffixing a scope to this path e.g. /pushrules/global/. This will return a subset of this data
under the specified key e.g. the global key. (11.10.1.4.6)
)"};
resource pushrules
{
"/_matrix/client/r0/pushrules",
{
description
}
};
resource::response
get_pushrules(client &client, const resource::request &request)
try
{
return resource::response
{
client, json::members
{
{ "global", json::members
{
{ "content", json::array{} },
{ "override", json::array{} },
{ "room", json::array{} },
{ "sender", json::array{} },
{ "underride", json::array{} },
}}
}
};
}
catch(...)
{
throw;
}
resource::method get_method
{
pushrules, "GET", get_pushrules
};
mapi::header IRCD_MODULE
{
"registers the resource 'client/pushrules' to handle requests"
};