2018-04-10 04:38:41 +02: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_ROOMS_H
|
|
|
|
|
2018-10-24 23:01:21 +02:00
|
|
|
/// Convenience iterface for rooms; utilities for the server's collection of
|
|
|
|
/// rooms and some rooms list related linkages.
|
2018-04-10 04:38:41 +02:00
|
|
|
///
|
|
|
|
namespace ircd::m::rooms
|
|
|
|
{
|
2018-04-12 00:10:45 +02:00
|
|
|
// All rooms known to IRCd
|
2018-10-24 23:08:14 +02:00
|
|
|
bool for_each(const string_view &room_id_lb, const room::id::closure_bool &);
|
|
|
|
bool for_each(const room::id::closure_bool &);
|
2018-04-10 04:38:41 +02:00
|
|
|
void for_each(const room::id::closure &);
|
2018-10-24 23:08:14 +02:00
|
|
|
bool for_each(const room::closure_bool &);
|
2018-04-10 04:38:41 +02:00
|
|
|
void for_each(const room::closure &);
|
2018-04-12 00:10:45 +02:00
|
|
|
|
|
|
|
// All rooms for a user (alias to interface in user::)
|
2018-10-24 23:08:14 +02:00
|
|
|
bool for_each(const user &, const string_view &membership, const user::rooms::closure_bool &);
|
2018-04-12 00:28:00 +02:00
|
|
|
void for_each(const user &, const string_view &membership, const user::rooms::closure &);
|
2018-10-24 23:08:14 +02:00
|
|
|
bool for_each(const user &, const user::rooms::closure_bool &);
|
2018-04-12 00:28:00 +02:00
|
|
|
void for_each(const user &, const user::rooms::closure &);
|
2018-10-24 23:01:21 +02:00
|
|
|
|
2018-10-25 01:50:54 +02:00
|
|
|
// All public rooms only; key is either a server hostname or room_id.
|
|
|
|
// - for server hostname: iterates known rooms from that server.
|
|
|
|
// - for room_id: starts iteration from that (or closest) room_id
|
|
|
|
// which can be used as a since/pagination token.
|
|
|
|
bool for_each_public(const string_view &key, const room::id::closure_bool &);
|
2018-10-24 23:15:36 +02:00
|
|
|
bool for_each_public(const room::id::closure_bool &);
|
|
|
|
|
2018-10-24 23:22:10 +02:00
|
|
|
size_t count_public(const string_view &server = {});
|
|
|
|
|
2018-10-24 23:01:21 +02:00
|
|
|
// Linkage to utils that build a publicrooms summary from room state.
|
|
|
|
void summary_chunk(const m::room &, json::stack::object &chunk);
|
|
|
|
json::object summary_chunk(const m::room &, const mutable_buffer &out);
|
2018-10-25 02:51:33 +02:00
|
|
|
event::id::buf summary_set(const m::room::id &, const json::object &summary);
|
|
|
|
event::id::buf summary_set(const m::room &);
|
2018-04-10 04:38:41 +02:00
|
|
|
}
|