diff options
| author | 2022-10-07 18:12:58 +0100 | |
|---|---|---|
| committer | 2022-10-12 08:50:06 +0100 | |
| commit | e37ee111a8bb9189b495489dce2fb90180160ebe (patch) | |
| tree | f260e6029abd702b3c2b1a63cd25dc7704d1e9a9 /src/modules/m_auditorium.cpp | |
| parent | Allow modules to control the visible channel in a WHO request. (diff) | |
Fix channels with +D or +u set being picked for the /WHO response.
Diffstat (limited to 'src/modules/m_auditorium.cpp')
| -rw-r--r-- | src/modules/m_auditorium.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp index 0e18d3e36..9960b0a78 100644 --- a/src/modules/m_auditorium.cpp +++ b/src/modules/m_auditorium.cpp @@ -64,6 +64,7 @@ class ModuleAuditorium : public Module , public Names::EventListener , public Who::EventListener + , public Who::VisibleEventListener { CheckExemption::EventProvider exemptionprov; AuditoriumMode aum; @@ -76,6 +77,7 @@ class ModuleAuditorium ModuleAuditorium() : Names::EventListener(this) , Who::EventListener(this) + , Who::VisibleEventListener(this) , exemptionprov(this) , aum(this) , joinhook(this) @@ -193,6 +195,12 @@ class ModuleAuditorium return MOD_RES_PASSTHRU; return MOD_RES_DENY; } + + ModResult OnWhoVisible(const Who::Request& request, LocalUser* source, Membership* memb) CXX11_OVERRIDE + { + // Never pick a channel as the first visible one if the channel is in auditorium mode. + return IsVisible(memb) || CanSee(source, memb) ? MOD_RES_PASSTHRU : MOD_RES_DENY; + } }; JoinHook::JoinHook(ModuleAuditorium* mod) |
