2020-03-18 05:57:44 +01:00
|
|
|
// The Construct
|
|
|
|
//
|
|
|
|
// Copyright (C) The Construct Developers, Authors & Contributors
|
|
|
|
// Copyright (C) 2016-2020 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_PUSHRULES_H
|
|
|
|
|
|
|
|
struct ircd::m::user::pushrules
|
|
|
|
{
|
2020-03-18 21:18:04 +01:00
|
|
|
using path = push::path;
|
2020-03-18 21:59:33 +01:00
|
|
|
using closure_bool = std::function<bool (const path &, const json::object &)>;
|
|
|
|
using closure = std::function<void (const path &, const json::object &)>;
|
2020-03-18 05:57:44 +01:00
|
|
|
|
|
|
|
m::user user;
|
|
|
|
|
|
|
|
public:
|
2020-03-18 21:59:33 +01:00
|
|
|
bool for_each(const path &, const closure_bool &) const;
|
2020-03-18 05:57:44 +01:00
|
|
|
bool for_each(const closure_bool &) const;
|
|
|
|
bool get(std::nothrow_t, const path &, const closure &) const;
|
|
|
|
void get(const path &, const closure &) const;
|
2020-03-18 21:59:33 +01:00
|
|
|
bool set(const path &, const json::object &value) const;
|
|
|
|
bool del(const path &) const;
|
2020-03-18 05:57:44 +01:00
|
|
|
|
|
|
|
pushrules(const m::user &user) noexcept;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline
|
|
|
|
ircd::m::user::pushrules::pushrules(const m::user &user)
|
|
|
|
noexcept
|
|
|
|
:user{user}
|
|
|
|
{}
|