0
0
Fork 0
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:
Jason Volk 2019-07-19 14:27:34 -07:00
parent e57561e8c1
commit c9745570fc
2 changed files with 22 additions and 0 deletions

View file

@ -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 &);

View file

@ -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)
{