From 24aac22e33c20b69334b2a0839485f9994eb0c82 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 14 Feb 2018 14:29:26 -0800 Subject: [PATCH] modules/client/account: Stub an account/3pid response. --- modules/Makefile.am | 1 + modules/client/account/3pid.cc | 69 ++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 modules/client/account/3pid.cc diff --git a/modules/Makefile.am b/modules/Makefile.am index 2ed37d265..9eead314e 100644 --- a/modules/Makefile.am +++ b/modules/Makefile.am @@ -143,6 +143,7 @@ client_module_LTLIBRARIES += client/client_user.la # client_client_account_la_SOURCES = \ + client/account/3pid.cc \ client/account/whoami.cc \ client/account/password.cc \ client/account/deactivate.cc \ diff --git a/modules/client/account/3pid.cc b/modules/client/account/3pid.cc new file mode 100644 index 000000000..779a7b872 --- /dev/null +++ b/modules/client/account/3pid.cc @@ -0,0 +1,69 @@ +// Matrix Construct +// +// Copyright (C) Matrix Construct Developers, Authors & Contributors +// Copyright (C) 2016-2018 Jason Volk +// +// 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; + +resource +account_3pid +{ + "/_matrix/client/r0/account/3pid", + { + "(3.5) Adding Account Administrative Contact Information" + } +}; + +resource::response +get__3pid(client &client, + const resource::request &request) +{ + std::vector vec; + json::value threepids + { + vec.data(), vec.size() + }; + + return resource::response + { + client, json::members + { + { "threepids", threepids } + } + }; +} + +resource::method +get_3pid +{ + account_3pid, "GET", get__3pid, + { + get_3pid.REQUIRES_AUTH + } +}; + +resource::response +post__3pid(client &client, + const resource::request &request) +{ + return resource::response + { + client, http::OK + }; +} + +resource::method +post_3pid +{ + account_3pid, "POST", post__3pid, + { + post_3pid.REQUIRES_AUTH + } +};