0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-19 19:33:45 +02:00

ircd::m/modules: Update various client listeners w/ callback.

This commit is contained in:
Jason Volk 2018-07-06 18:40:15 -07:00
parent 02fcdc8635
commit dd037988f3
2 changed files with 11 additions and 2 deletions

View file

@ -238,7 +238,11 @@ ircd::m::init_listener(const json::object &config,
const string_view &name,
const json::object &opts)
{
m::listeners.emplace_back(name, opts);
m::listeners.emplace_back(name, opts, []
(const auto &sock)
{
add_client(sock);
});
}
void

View file

@ -35,7 +35,12 @@ struct listener::listen
{
const std::string a(args[0]);
const ircd::json::object o(a);
l = new net::listener(o.get("name", "js"), o);
l = new net::listener(o.get("name", "js"), o, []
(const auto &sock)
{
add_client(sock);
});
return {};
}