mirror of
https://github.com/matrix-construct/construct
synced 2025-02-19 18:20:19 +01:00
modules/s_listen: Minor cleanup.
This commit is contained in:
parent
9cee6a40c9
commit
ebd8539ce1
1 changed files with 29 additions and 22 deletions
|
@ -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" },
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue