2018-01-22 12:32:15 +01:00
|
|
|
// 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
|
2020-03-06 04:35:20 +01:00
|
|
|
#define HAVE_IRCD_M_FED_EVENT_H
|
2018-01-22 12:32:15 +01:00
|
|
|
|
2020-03-06 04:35:20 +01:00
|
|
|
namespace ircd::m::fed
|
2018-01-22 12:32:15 +01:00
|
|
|
{
|
|
|
|
struct event;
|
|
|
|
};
|
|
|
|
|
2020-03-06 04:35:20 +01:00
|
|
|
struct ircd::m::fed::event
|
2020-03-08 02:15:58 +01:00
|
|
|
:request
|
2018-01-22 12:32:15 +01:00
|
|
|
{
|
2019-08-30 03:27:08 +02:00
|
|
|
explicit operator json::object() const;
|
|
|
|
explicit operator m::event() const;
|
2018-01-22 12:32:15 +01:00
|
|
|
|
2020-03-08 02:15:58 +01:00
|
|
|
event(const m::event::id &,
|
|
|
|
const mutable_buffer &,
|
|
|
|
opts);
|
2018-01-22 12:32:15 +01:00
|
|
|
|
2020-03-08 02:15:58 +01:00
|
|
|
event() = default;
|
2018-01-22 12:32:15 +01:00
|
|
|
};
|
2019-08-30 03:27:08 +02:00
|
|
|
|
|
|
|
inline
|
2020-03-06 04:35:20 +01:00
|
|
|
ircd::m::fed::event::operator
|
2019-08-30 03:27:08 +02:00
|
|
|
ircd::m::event()
|
|
|
|
const
|
|
|
|
{
|
|
|
|
return json::object{*this};
|
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
2020-03-06 04:35:20 +01:00
|
|
|
ircd::m::fed::event::operator
|
2019-08-30 03:27:08 +02:00
|
|
|
ircd::json::object()
|
|
|
|
const
|
|
|
|
{
|
|
|
|
const json::object object
|
|
|
|
{
|
|
|
|
in.content
|
|
|
|
};
|
|
|
|
|
|
|
|
const json::array pdus
|
|
|
|
{
|
|
|
|
object.at("pdus")
|
|
|
|
};
|
|
|
|
|
|
|
|
return pdus.at(0);
|
|
|
|
}
|