0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-28 23:08:20 +02:00

modules/s_listen: Minor cleanup.

This commit is contained in:
Jason Volk 2018-08-17 14:28:53 -07:00
parent 9cee6a40c9
commit ebd8539ce1

View file

@ -28,7 +28,8 @@ decltype(listeners)
listeners;
//
// init
// On module load any existing listener descriptions are sought out
// of room state and instantiated (i.e on startup).
//
void
@ -63,6 +64,33 @@ init_listeners()
};
}
//
// Upon processing of a new event which saved a listener description
// to room state in its content, we instantiate the listener here.
//
static void
create_listener(const m::event &event)
{
init_listener(event);
}
/// Hook for a new listener description being sent.
const m::hookfn<>
create_listener_hook
{
create_listener,
{
{ "_site", "vm.notify" },
{ "room_id", "!ircd" },
{ "type", "ircd.listen" },
}
};
//
// Common
//
void
init_listener(const m::event &event)
{
@ -97,24 +125,3 @@ init_listener(const string_view &name,
ircd::add_client(sock);
});
}
//
//
//
static void
create_listener(const m::event &event)
{
init_listener(event);
}
const m::hookfn<>
create_listener_hook
{
create_listener,
{
{ "_site", "vm.notify" },
{ "room_id", "!ircd" },
{ "type", "ircd.listen" },
}
};