mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 15:04:10 +01:00
ircd:Ⓜ️:push::request: Add conf item to toggle functionality.
This commit is contained in:
parent
891cba3fb9
commit
cc8c9942a4
3 changed files with 12 additions and 0 deletions
|
@ -38,6 +38,7 @@ namespace ircd::m::push
|
|||
struct ircd::m::push::request
|
||||
:instance_list<ircd::m::push::request>
|
||||
{
|
||||
static conf::item<bool> enable;
|
||||
static conf::item<seconds> timeout;
|
||||
static ctx::mutex mutex;
|
||||
static ctx::dock dock;
|
||||
|
|
|
@ -42,6 +42,13 @@ ircd::util::instance_list<ircd::m::push::request>::list
|
|||
allocator
|
||||
};
|
||||
|
||||
decltype(ircd::m::push::request::enable)
|
||||
ircd::m::push::request::enable
|
||||
{
|
||||
{ "name", "ircd.m.push.request.enable" },
|
||||
{ "default", true },
|
||||
};
|
||||
|
||||
decltype(ircd::m::push::request::timeout)
|
||||
ircd::m::push::request::timeout
|
||||
{
|
||||
|
|
|
@ -185,6 +185,10 @@ ircd::m::push::handle_event(const m::event &event,
|
|||
vm::eval &eval)
|
||||
try
|
||||
{
|
||||
// Pushing disabled by configuration
|
||||
if(!request::enable)
|
||||
return;
|
||||
|
||||
// All pusher notifications are generated from internal rooms only
|
||||
if(!eval.room_internal)
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue