2018-03-04 13:28:36 +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
|
|
|
|
#define HAVE_IRCD_M_TYPING_H
|
|
|
|
|
|
|
|
namespace ircd::m
|
|
|
|
{
|
2018-03-15 00:24:58 +01:00
|
|
|
struct typing;
|
2018-03-04 13:28:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#pragma GCC diagnostic push
|
|
|
|
#pragma GCC diagnostic ignored "-Wsubobject-linkage"
|
|
|
|
struct ircd::m::edu::m_typing
|
|
|
|
:json::tuple
|
|
|
|
<
|
|
|
|
json::property<name::user_id, json::string>,
|
|
|
|
json::property<name::room_id, json::string>,
|
2018-09-17 03:27:43 +02:00
|
|
|
json::property<name::timeout, time_t>,
|
2018-03-04 13:28:36 +01:00
|
|
|
json::property<name::typing, bool>
|
|
|
|
>
|
|
|
|
{
|
|
|
|
using super_type::tuple;
|
|
|
|
using super_type::operator=;
|
|
|
|
};
|
|
|
|
#pragma GCC diagnostic pop
|
2018-03-15 00:24:58 +01:00
|
|
|
|
|
|
|
struct ircd::m::typing
|
|
|
|
:m::edu::m_typing
|
|
|
|
{
|
2018-09-17 03:27:43 +02:00
|
|
|
struct commit;
|
2018-03-15 00:24:58 +01:00
|
|
|
|
2018-09-17 04:27:58 +02:00
|
|
|
using closure_bool = std::function<bool (const typing &)>;
|
|
|
|
using closure = std::function<void (const typing &)>;
|
|
|
|
|
|
|
|
//NOTE: no yielding in this iteration.
|
|
|
|
static bool for_each(const closure_bool &);
|
|
|
|
static void for_each(const closure &);
|
|
|
|
|
2018-03-15 00:24:58 +01:00
|
|
|
using edu::m_typing::m_typing;
|
|
|
|
};
|
2018-09-17 03:27:43 +02:00
|
|
|
|
|
|
|
struct ircd::m::typing::commit
|
|
|
|
:event::id::buf
|
|
|
|
{
|
|
|
|
commit(const typing &);
|
|
|
|
};
|