]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sslmodes.cpp
Fix unnecessary inlining in command handler constructors.
[user/henk/code/inspircd.git] / src / modules / m_sslmodes.cpp
index 67128e6bd59596076437feb3288f0e09034c52ae..e2a5bc930be5fc4b4db8885786ca02e0d62fea6b 100644 (file)
@@ -1,12 +1,15 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
- *   Copyright (C) 2013 Shawn Smith <shawn@inspircd.org>
- *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
- *   Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
+ *   Copyright (C) 2013, 2017-2019 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2013 Shawn Smith <ShawnSmith0828@gmail.com>
+ *   Copyright (C) 2012-2014 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
+ *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
+ *   Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
  *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
- *   Copyright (C) 2006 Craig Edwards <craigedwards@brainbox.cc>
- *   Copyright (C) 2006 Oliver Lupton <oliverlupton@gmail.com>
+ *   Copyright (C) 2006-2007, 2010 Craig Edwards <brain@inspircd.org>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
  * redistribute it and/or modify it under the terms of the GNU General Public
@@ -61,15 +64,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);