From e2ddeb419015063c9818f7007c7a4cf0df074364 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 4 Mar 2018 04:28:36 -0800 Subject: [PATCH] ircd::m: Add edu tuples; improve txn tuple typing. --- include/ircd/m/edu.h | 35 +++++++++++++++++++++++++++++++++++ include/ircd/m/m.h | 4 ++++ include/ircd/m/name.h | 12 ++++++++++++ include/ircd/m/presence.h | 33 +++++++++++++++++++++++++++++++++ include/ircd/m/receipt.h | 31 +++++++++++++++++++++++++++++++ include/ircd/m/txn.h | 8 ++++---- include/ircd/m/typing.h | 32 ++++++++++++++++++++++++++++++++ 7 files changed, 151 insertions(+), 4 deletions(-) create mode 100644 include/ircd/m/edu.h create mode 100644 include/ircd/m/presence.h create mode 100644 include/ircd/m/receipt.h create mode 100644 include/ircd/m/typing.h diff --git a/include/ircd/m/edu.h b/include/ircd/m/edu.h new file mode 100644 index 000000000..36ad185cf --- /dev/null +++ b/include/ircd/m/edu.h @@ -0,0 +1,35 @@ +// 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_EDU_H + +namespace ircd::m +{ + struct edu; +} + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsubobject-linkage" +struct ircd::m::edu +:json::tuple +< + json::property, + json::property +> +{ + struct m_presence; + struct m_typing; + struct m_receipt; + + using super_type::tuple; + using super_type::operator=; +}; +#pragma GCC diagnostic pop diff --git a/include/ircd/m/m.h b/include/ircd/m/m.h index c31327f91..d3edad54b 100644 --- a/include/ircd/m/m.h +++ b/include/ircd/m/m.h @@ -56,6 +56,10 @@ namespace ircd #include "v1/v1.h" #include "vm.h" #include "keys.h" +#include "edu.h" +#include "presence.h" +#include "typing.h" +#include "receipt.h" #include "txn.h" #include "hook.h" diff --git a/include/ircd/m/name.h b/include/ircd/m/name.h index e492088e4..c83d27055 100644 --- a/include/ircd/m/name.h +++ b/include/ircd/m/name.h @@ -88,4 +88,16 @@ namespace ircd::m::name constexpr const char *const senders {"senders"}; constexpr const char *const not_senders {"not_senders"}; constexpr const char *const limit {"limit"}; + + constexpr const char *const edu_type {"edu_type"}; + + constexpr const char *const user_id {"user_id"}; + constexpr const char *const last_active_ago {"last_active_ago"}; + constexpr const char *const currently_active {"currently_active"}; + constexpr const char *const status_msg {"status_msg"}; + + constexpr const char *const ts {"ts"}; + constexpr const char *const event_ids {"event_ids"}; + + constexpr const char *const typing {"typing"}; } diff --git a/include/ircd/m/presence.h b/include/ircd/m/presence.h new file mode 100644 index 000000000..e3832d1d1 --- /dev/null +++ b/include/ircd/m/presence.h @@ -0,0 +1,33 @@ +// 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_PRESENCE_H + +namespace ircd::m +{ + +} + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsubobject-linkage" +struct ircd::m::edu::m_presence +:json::tuple +< + json::property, + json::property, + json::property, + json::property +> +{ + using super_type::tuple; + using super_type::operator=; +}; +#pragma GCC diagnostic pop diff --git a/include/ircd/m/receipt.h b/include/ircd/m/receipt.h new file mode 100644 index 000000000..a49930cbd --- /dev/null +++ b/include/ircd/m/receipt.h @@ -0,0 +1,31 @@ +// 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_RECEIPT_H + +namespace ircd::m +{ + +} + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsubobject-linkage" +struct ircd::m::edu::m_receipt +:json::tuple +< + json::property, + json::property +> +{ + using super_type::tuple; + using super_type::operator=; +}; +#pragma GCC diagnostic pop diff --git a/include/ircd/m/txn.h b/include/ircd/m/txn.h index f3b41b066..409c6c96f 100644 --- a/include/ircd/m/txn.h +++ b/include/ircd/m/txn.h @@ -21,11 +21,11 @@ namespace ircd::m struct ircd::m::txn :json::tuple < - json::property, - json::property, + json::property, + json::property, json::property, - json::property, - json::property + json::property, + json::property > { using super_type::tuple; diff --git a/include/ircd/m/typing.h b/include/ircd/m/typing.h new file mode 100644 index 000000000..8c2d09ca3 --- /dev/null +++ b/include/ircd/m/typing.h @@ -0,0 +1,32 @@ +// 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_TYPING_H + +namespace ircd::m +{ + +} + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsubobject-linkage" +struct ircd::m::edu::m_typing +:json::tuple +< + json::property, + json::property, + json::property +> +{ + using super_type::tuple; + using super_type::operator=; +}; +#pragma GCC diagnostic pop