mirror of
https://github.com/matrix-construct/construct
synced 2025-03-17 06:50:23 +01:00
ircd:Ⓜ️:room: Add contains() tool.
This commit is contained in:
parent
9768bbd1c6
commit
a73b538349
2 changed files with 12 additions and 0 deletions
|
@ -32,6 +32,7 @@ namespace ircd::m
|
|||
bool internal(const id::room &);
|
||||
bool federated(const id::room &);
|
||||
bool creator(const id::room &, const id::user &);
|
||||
bool contains(const id::room &, const event::idx &);
|
||||
bool membership(const room &, const id::user &, const string_view & = "join");
|
||||
bool join_rule(const room &, const string_view &rule);
|
||||
bool visible(const room &, const string_view &mxid, const m::event *const & = nullptr);
|
||||
|
|
|
@ -768,6 +768,17 @@ ircd::m::type(const mutable_buffer &buf,
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::m::contains(const id::room &room_id,
|
||||
const event::idx &event_idx)
|
||||
{
|
||||
return m::query(event_idx, "room_id", [&room_id]
|
||||
(const string_view &_room_id) -> bool
|
||||
{
|
||||
return _room_id == room_id;
|
||||
});
|
||||
}
|
||||
|
||||
ircd::m::id::user::buf
|
||||
ircd::m::creator(const id::room &room_id)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue