0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-16 08:58:20 +02:00
construct/include/ircd/m/user/account_data.h
Jason Volk df8fd36fde ircd:Ⓜ️:user: Simplify user::room_tags impl w/ modern linkage.
ircd:Ⓜ️:user: Simplify user::room_account_data impl w/ modern linkage.

ircd:Ⓜ️:user: Modernize user::profile impl linkage.

ircd:Ⓜ️:user: Modernize user::account_data impl linkage.

ircd:Ⓜ️:user: Simplify user::ignores impl w/ modern linkage.
2019-07-13 18:15:27 -07:00

32 lines
1.1 KiB
C++

// Matrix Construct
//
// Copyright (C) Matrix Construct Developers, Authors & Contributors
// Copyright (C) 2016-2019 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_USER_ACCOUNT_DATA_H
struct ircd::m::user::account_data
{
using closure_bool = std::function<bool (const string_view &key, const json::object &)>;
using closure = std::function<void (const string_view &key, const json::object &)>;
m::user user;
public:
bool for_each(const closure_bool &) const;
bool get(std::nothrow_t, const string_view &type, const closure &) const;
void get(const string_view &type, const closure &) const;
json::object get(const mutable_buffer &out, const string_view &type) const; //nothrow
event::id::buf set(const string_view &type, const json::object &value) const;
account_data(const m::user &user)
:user{user}
{}
};