mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd:Ⓜ️:v1: Split user:: / user::keys headers.
This commit is contained in:
parent
a4bd140cc2
commit
dcb1f2197e
4 changed files with 82 additions and 61 deletions
|
@ -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<const string_view>;
|
||||
using user_devices = std::pair<m::user::id, devices>;
|
||||
|
||||
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 user_devices> &,
|
||||
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;
|
||||
|
|
75
include/ircd/m/v1/user_keys.h
Normal file
75
include/ircd/m/v1/user_keys.h
Normal file
|
@ -0,0 +1,75 @@
|
|||
// 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.
|
||||
|
||||
#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<const string_view>;
|
||||
using user_devices = std::pair<m::user::id, devices>;
|
||||
|
||||
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 user_devices> &,
|
||||
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;
|
||||
};
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue