diff options
author | Peter Powell <petpow@saberuk.com> | 2019-06-07 01:34:51 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-06-07 01:34:51 +0100 |
commit | 1e60f38babe109dd69a5f668dbb34680f4007b98 (patch) | |
tree | 98a692236b46ea15167dc846428ab3288cdd0a7e /src | |
parent | 806b4d55a2f19b6521c34af6210c323a1beb414b (diff) |
Show how many users are non-SSL in ERR_ALLMUSTSSL.
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_sslmodes.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp index 67128e6bd..10002ca57 100644 --- a/src/modules/m_sslmodes.cpp +++ b/src/modules/m_sslmodes.cpp @@ -61,15 +61,20 @@ class SSLMode : public ModeHandler return MODEACTION_DENY; } + unsigned long nonssl = 0; const Channel::MemberMap& userlist = channel->GetUsers(); for (Channel::MemberMap::const_iterator i = userlist.begin(); i != userlist.end(); ++i) { ssl_cert* cert = API->GetCertificate(i->first); if (!cert && !i->first->server->IsULine()) - { - source->WriteNumeric(ERR_ALLMUSTSSL, channel->name, "all members of the channel must be connected via SSL"); - return MODEACTION_DENY; - } + nonssl++; + } + + if (nonssl) + { + source->WriteNumeric(ERR_ALLMUSTSSL, channel->name, InspIRCd::Format("All members of the channel must be connected via SSL (%lu/%lu are non-SSL)", + nonssl, static_cast<unsigned long>(userlist.size()))); + return MODEACTION_DENY; } } channel->SetMode(this, true); |