0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 00:32:35 +01:00

modules/net_dns: Simplify room create hook related.

This commit is contained in:
Jason Volk 2019-08-18 01:58:15 -07:00
parent 8454ae0275
commit 17846bdeb1

View file

@ -929,20 +929,12 @@ catch(const std::exception &e)
// cache room creation // cache room creation
// //
namespace ircd::net::dns::cache namespace ircd::net::dns {
namespace [[gnu::visibility("hidden")]] cache
{ {
static void create_room(); static void create_room();
extern bool room_exists;
extern m::hookfn<m::vm::eval &> create_room_hook; extern m::hookfn<m::vm::eval &> create_room_hook;
extern const ircd::run::changed create_room_hook_alt; }}
}
decltype(ircd::net::dns::cache::room_exists)
ircd::net::dns::cache::room_exists
{
m::exists(room_id)
};
decltype(ircd::net::dns::cache::create_room_hook) decltype(ircd::net::dns::cache::create_room_hook)
ircd::net::dns::cache::create_room_hook ircd::net::dns::cache::create_room_hook
@ -958,22 +950,6 @@ ircd::net::dns::cache::create_room_hook
} }
}; };
/// This is for existing installations that won't catch an
/// !ircd room create and must create this room.
decltype(ircd::net::dns::cache::create_room_hook_alt)
ircd::net::dns::cache::create_room_hook_alt{[]
(const auto &level)
{
if(level != run::level::RUN || room_exists)
return;
context{[]
{
if(m::exists(m::my_room)) // if false, the other hook will succeed.
create_room();
}};
}};
void void
ircd::net::dns::cache::create_room() ircd::net::dns::cache::create_room()
try try