2019-05-11 23:15:14 +02:00
|
|
|
// Matrix Construct
|
|
|
|
//
|
|
|
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
|
|
|
// Copyright (C) 2016-2019 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_DBS_EVENT_SENDER_H
|
|
|
|
|
|
|
|
namespace ircd::m::dbs
|
|
|
|
{
|
2023-02-18 03:37:46 +01:00
|
|
|
using event_sender_tuple = std::tuple<event::idx>;
|
|
|
|
using event_sender_origin_tuple = std::tuple<string_view, event::idx>;
|
|
|
|
|
2019-05-11 23:15:14 +02:00
|
|
|
constexpr size_t EVENT_SENDER_KEY_MAX_SIZE
|
|
|
|
{
|
|
|
|
id::MAX_SIZE + 1 + 8
|
|
|
|
};
|
|
|
|
|
2019-08-20 03:06:37 +02:00
|
|
|
// sender keyspace
|
|
|
|
bool is_event_sender_key(const string_view &amalgam);
|
|
|
|
string_view event_sender_key(const mutable_buffer &out, const id::user &, const event::idx & = 0UL);
|
2023-02-18 03:37:46 +01:00
|
|
|
event_sender_tuple event_sender_key(const string_view &amalgam);
|
2019-05-11 23:15:14 +02:00
|
|
|
|
2019-08-20 03:06:37 +02:00
|
|
|
// sender_origin keyspace
|
|
|
|
bool is_event_sender_origin_key(const string_view &amalgam);
|
|
|
|
string_view event_sender_origin_key(const mutable_buffer &out, const string_view &origin, const string_view &localpart = {}, const event::idx & = 0UL);
|
|
|
|
string_view event_sender_origin_key(const mutable_buffer &out, const id::user &, const event::idx &);
|
2023-02-18 03:37:46 +01:00
|
|
|
event_sender_origin_tuple event_sender_origin_key(const string_view &amalgam);
|
2019-08-20 03:06:37 +02:00
|
|
|
|
2023-02-11 04:43:00 +01:00
|
|
|
void _index_event_sender(db::txn &, const event &, const opts &);
|
2020-03-25 19:06:29 +01:00
|
|
|
|
2019-08-20 03:06:37 +02:00
|
|
|
// mxid | event_idx
|
|
|
|
// host | local, event_idx (see event_sender_origin.h)
|
2019-06-11 21:55:14 +02:00
|
|
|
extern db::domain event_sender;
|
2019-05-11 23:15:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace ircd::m::dbs::desc
|
|
|
|
{
|
2020-10-02 04:04:48 +02:00
|
|
|
extern conf::item<std::string> event_sender__comp;
|
2020-03-25 19:06:29 +01:00
|
|
|
extern conf::item<size_t> event_sender__block__size;
|
|
|
|
extern conf::item<size_t> event_sender__meta_block__size;
|
|
|
|
extern conf::item<size_t> event_sender__cache__size;
|
|
|
|
extern conf::item<size_t> event_sender__cache_comp__size;
|
|
|
|
extern const db::prefix_transform event_sender__pfx;
|
|
|
|
extern const db::descriptor event_sender;
|
2019-05-11 23:15:14 +02:00
|
|
|
}
|