From bf2df9c223a6620671bb377897f6958967368ef6 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 11 Dec 2019 11:01:11 -0800 Subject: [PATCH] ircd::m: Add a tuple structure for m_relates_to. --- include/ircd/m/m.h | 1 + include/ircd/m/name.h | 2 ++ include/ircd/m/relates.h | 28 ++++++++++++++++++++++++++++ matrix/name.cc | 2 ++ 4 files changed, 33 insertions(+) create mode 100644 include/ircd/m/relates.h diff --git a/include/ircd/m/m.h b/include/ircd/m/m.h index 676ebea3e..8adc7513d 100644 --- a/include/ircd/m/m.h +++ b/include/ircd/m/m.h @@ -78,6 +78,7 @@ namespace ircd #include "typing.h" #include "receipt.h" #include "direct_to_device.h" +#include "relates.h" #include "txn.h" #include "hook.h" #include "visible.h" diff --git a/include/ircd/m/name.h b/include/ircd/m/name.h index 3f39b271a..fcd46c1d9 100644 --- a/include/ircd/m/name.h +++ b/include/ircd/m/name.h @@ -178,4 +178,6 @@ struct ircd::m::name static constexpr const char *const include_state {"include_state"}; static constexpr const char *const groupings {"groupings"}; static constexpr const char *const filter {"filter"}; + + static constexpr const char *const rel_type {"rel_type"}; }; diff --git a/include/ircd/m/relates.h b/include/ircd/m/relates.h new file mode 100644 index 000000000..321e80312 --- /dev/null +++ b/include/ircd/m/relates.h @@ -0,0 +1,28 @@ +// 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_RELATES_H + +namespace ircd::m +{ + struct relates_to; +} + +struct ircd::m::relates_to +:json::tuple +< + json::property, + json::property +> +{ + using super_type::tuple; + using super_type::operator=; +}; diff --git a/matrix/name.cc b/matrix/name.cc index 72d9c03e6..089382fca 100644 --- a/matrix/name.cc +++ b/matrix/name.cc @@ -157,3 +157,5 @@ constexpr const char *const ircd::m::name::event_context; constexpr const char *const ircd::m::name::include_state; constexpr const char *const ircd::m::name::groupings; constexpr const char *const ircd::m::name::filter; + +constexpr const char *const ircd::m::name::rel_type;