diff --git a/include/ircd/m/v1/user.h b/include/ircd/m/v1/user.h index d98ffc97d..fb184f7d2 100644 --- a/include/ircd/m/v1/user.h +++ b/include/ircd/m/v1/user.h @@ -17,12 +17,6 @@ namespace ircd::m::v1::user struct devices; } -namespace ircd::m::v1::user::keys -{ - struct claim; - struct query; -} - struct ircd::m::v1::user::devices :server::request { @@ -38,60 +32,6 @@ struct ircd::m::v1::user::devices devices() = default; }; -struct ircd::m::v1::user::keys::query -:server::request -{ - using opts = v1::user::opts; - - using devices = vector_view; - using user_devices = std::pair; - - explicit operator json::object() const - { - const json::object object{in.content}; - return object; - } - - explicit - query(const json::object &content, - const mutable_buffer &, - opts); - - query(const vector_view &, - const mutable_buffer &, - opts); - - query(const user_devices &, - const mutable_buffer &, - opts); - - query(const m::user::id &, - const string_view &device_id, - const mutable_buffer &, - opts); - - query(const m::user::id &, - const mutable_buffer &, - opts); - - query() = default; -}; - -struct ircd::m::v1::user::keys::claim -:server::request -{ - using opts = v1::user::opts; - - explicit operator json::object() const - { - const json::object object{in.content}; - return object; - } - - explicit claim(const json::object &content, const mutable_buffer &, opts); - claim() = default; -}; - struct ircd::m::v1::user::opts { net::hostport remote; diff --git a/include/ircd/m/v1/user_keys.h b/include/ircd/m/v1/user_keys.h new file mode 100644 index 000000000..687ad94f6 --- /dev/null +++ b/include/ircd/m/v1/user_keys.h @@ -0,0 +1,75 @@ +// 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. + +#pragma once +#define HAVE_IRCD_M_V1_USER_H + +namespace ircd::m::v1::user::keys +{ + struct claim; + struct query; +} + +struct ircd::m::v1::user::keys::query +:server::request +{ + using opts = v1::user::opts; + using devices = vector_view; + using user_devices = std::pair; + + explicit operator json::object() const + { + const json::object object{in.content}; + return object; + } + + explicit + query(const json::object &content, + const mutable_buffer &, + opts); + + query(const vector_view &, + const mutable_buffer &, + opts); + + query(const user_devices &, + const mutable_buffer &, + opts); + + query(const m::user::id &, + const string_view &device_id, + const mutable_buffer &, + opts); + + query(const m::user::id &, + const mutable_buffer &, + opts); + + query() = default; +}; + +struct ircd::m::v1::user::keys::claim +:server::request +{ + using opts = v1::user::opts; + + explicit operator json::object() const + { + const json::object object{in.content}; + return object; + } + + explicit + claim(const json::object &content, + const mutable_buffer &, + opts); + + claim() = default; +}; diff --git a/include/ircd/m/v1/v1.h b/include/ircd/m/v1/v1.h index a02d924f4..8a336bedc 100644 --- a/include/ircd/m/v1/v1.h +++ b/include/ircd/m/v1/v1.h @@ -21,6 +21,7 @@ namespace ircd::m::v1 #include "key.h" #include "query.h" #include "user.h" +#include "user_keys.h" #include "make_join.h" #include "send_join.h" #include "invite.h" diff --git a/ircd/m_v1.cc b/ircd/m_v1.cc index df58b6c3e..509b4a22d 100644 --- a/ircd/m_v1.cc +++ b/ircd/m_v1.cc @@ -771,7 +771,7 @@ ircd::m::v1::make_join::make_join(const room::id &room_id, /////////////////////////////////////////////////////////////////////////////// // -// v1/user.h +// v1/user_keys.h // ircd::m::v1::user::keys::query::query(const m::user::id &user_id, @@ -934,6 +934,11 @@ ircd::m::v1::user::keys::claim::claim(const json::object &content, { } +/////////////////////////////////////////////////////////////////////////////// +// +// v1/user.h +// + ircd::m::v1::user::devices::devices(const id::user &user_id, const mutable_buffer &buf, opts opts)