mirror of
https://github.com/matrix-construct/construct
synced 2024-06-07 12:38:56 +02:00
ircd:Ⓜ️ Add internal(room) to interface.
This commit is contained in:
parent
e57561e8c1
commit
c9745570fc
|
@ -29,6 +29,7 @@ namespace ircd::m
|
|||
bool exists(const room &);
|
||||
bool exists(const id::room &);
|
||||
bool exists(const id::room_alias &, const bool &remote = false);
|
||||
bool internal(const id::room &);
|
||||
bool federate(const id::room &);
|
||||
id::user::buf creator(const id::room &);
|
||||
bool creator(const id::room &, const id::user &);
|
||||
|
|
|
@ -1128,6 +1128,27 @@ ircd::m::federate(const id::room &room_id)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/// Determine if this is an internal room. The following must be satisfied:
|
||||
///
|
||||
/// - The room was created by this origin.
|
||||
/// - The creator was the server itself, not any other user.
|
||||
bool
|
||||
ircd::m::internal(const id::room &room_id)
|
||||
{
|
||||
const m::room room
|
||||
{
|
||||
room_id
|
||||
};
|
||||
|
||||
if(!my(room))
|
||||
return false;
|
||||
|
||||
if(!creator(room, m::me))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::m::exists(const id::room &room_id)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue