2018-02-14 23:29:26 +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.
|
|
|
|
|
|
|
|
#include "account.h"
|
|
|
|
|
|
|
|
using namespace ircd;
|
|
|
|
|
2019-09-29 01:12:07 +02:00
|
|
|
m::resource
|
2018-02-14 23:29:26 +01:00
|
|
|
account_3pid
|
|
|
|
{
|
|
|
|
"/_matrix/client/r0/account/3pid",
|
|
|
|
{
|
|
|
|
"(3.5) Adding Account Administrative Contact Information"
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-09-29 01:12:07 +02:00
|
|
|
m::resource::response
|
2018-02-14 23:29:26 +01:00
|
|
|
get__3pid(client &client,
|
2019-09-29 01:12:07 +02:00
|
|
|
const m::resource::request &request)
|
2018-02-14 23:29:26 +01:00
|
|
|
{
|
|
|
|
std::vector<json::value> vec;
|
|
|
|
json::value threepids
|
|
|
|
{
|
|
|
|
vec.data(), vec.size()
|
|
|
|
};
|
|
|
|
|
2019-09-29 01:12:07 +02:00
|
|
|
return m::resource::response
|
2018-02-14 23:29:26 +01:00
|
|
|
{
|
|
|
|
client, json::members
|
|
|
|
{
|
|
|
|
{ "threepids", threepids }
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-09-29 01:12:07 +02:00
|
|
|
m::resource::method
|
2018-02-14 23:29:26 +01:00
|
|
|
get_3pid
|
|
|
|
{
|
|
|
|
account_3pid, "GET", get__3pid,
|
|
|
|
{
|
|
|
|
get_3pid.REQUIRES_AUTH
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-09-29 01:12:07 +02:00
|
|
|
m::resource::response
|
2018-02-14 23:29:26 +01:00
|
|
|
post__3pid(client &client,
|
2019-09-29 01:12:07 +02:00
|
|
|
const m::resource::request &request)
|
2018-02-14 23:29:26 +01:00
|
|
|
{
|
2019-09-29 01:12:07 +02:00
|
|
|
return m::resource::response
|
2018-02-14 23:29:26 +01:00
|
|
|
{
|
|
|
|
client, http::OK
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-09-29 01:12:07 +02:00
|
|
|
m::resource::method
|
2018-02-14 23:29:26 +01:00
|
|
|
post_3pid
|
|
|
|
{
|
|
|
|
account_3pid, "POST", post__3pid,
|
|
|
|
{
|
|
|
|
post_3pid.REQUIRES_AUTH
|
|
|
|
}
|
|
|
|
};
|