2020-04-07 21:34:43 +02:00
|
|
|
// The Construct
|
2019-03-15 21:20:05 +01:00
|
|
|
//
|
2020-04-07 21:34:43 +02:00
|
|
|
// Copyright (C) The Construct Developers, Authors & Contributors
|
|
|
|
// Copyright (C) 2016-2020 Jason Volk <jason@zemos.net>
|
2019-03-15 21:20:05 +01:00
|
|
|
//
|
|
|
|
// Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice is present in all copies. The
|
|
|
|
// full license for this software is available in the LICENSE file.
|
|
|
|
|
|
|
|
ircd::mapi::header
|
|
|
|
IRCD_MODULE
|
|
|
|
{
|
2020-04-10 02:24:50 +02:00
|
|
|
"Bridges (Application Services)"
|
2019-03-15 21:20:05 +01:00
|
|
|
};
|
|
|
|
|
2020-04-10 02:24:50 +02:00
|
|
|
namespace ircd::m::bridge
|
2019-03-15 21:20:05 +01:00
|
|
|
{
|
2020-04-07 21:34:43 +02:00
|
|
|
static void handle_event(const m::event &, vm::eval &);
|
2019-03-15 23:31:55 +01:00
|
|
|
|
2020-04-07 21:34:43 +02:00
|
|
|
extern hookfn<vm::eval &> notify_hook;
|
2019-03-15 21:20:05 +01:00
|
|
|
}
|
|
|
|
|
2020-04-10 02:24:50 +02:00
|
|
|
decltype(ircd::m::bridge::notify_hook)
|
|
|
|
ircd::m::bridge::notify_hook
|
2019-03-15 23:31:55 +01:00
|
|
|
{
|
2020-04-07 21:34:43 +02:00
|
|
|
handle_event,
|
2019-03-15 23:31:55 +01:00
|
|
|
{
|
2020-04-07 21:34:43 +02:00
|
|
|
{ "_site", "vm.notify" },
|
|
|
|
}
|
|
|
|
};
|
2019-03-15 23:31:55 +01:00
|
|
|
|
|
|
|
void
|
2020-04-10 02:24:50 +02:00
|
|
|
ircd::m::bridge::handle_event(const m::event &event,
|
|
|
|
vm::eval &eval)
|
2019-03-15 23:31:55 +01:00
|
|
|
try
|
|
|
|
{
|
2020-04-07 21:34:43 +02:00
|
|
|
// Drop internal room traffic
|
|
|
|
if(eval.room_internal)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Drop EDU's ???
|
|
|
|
if(!event.event_id)
|
|
|
|
return;
|
2019-03-15 23:31:55 +01:00
|
|
|
|
2020-04-10 02:24:50 +02:00
|
|
|
|
2019-03-15 23:31:55 +01:00
|
|
|
}
|
|
|
|
catch(const std::exception &e)
|
|
|
|
{
|
|
|
|
log::error
|
|
|
|
{
|
2020-04-10 02:24:50 +02:00
|
|
|
log, "Failed to handle for bridgelication services :%s",
|
2020-04-07 21:34:43 +02:00
|
|
|
e.what(),
|
2019-03-15 23:31:55 +01:00
|
|
|
};
|
|
|
|
}
|