]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sslmodes.cpp
Implement support for millisecond level server-time accuracy.
[user/henk/code/inspircd.git] / src / modules / m_sslmodes.cpp
index 1ff93b7adaabd99c6fbbadf9593e8aa5c139b249..10002ca57b722884e20319071c3c3563e48bed33 100644 (file)
@@ -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);
@@ -159,13 +164,13 @@ class ModuleSSLModes
                {
                        if (!api)
                        {
-                               user->WriteNumeric(ERR_SECUREONLYCHAN, cname, "Cannot join channel; unable to determine if you are an SSL user (+z)");
+                               user->WriteNumeric(ERR_SECUREONLYCHAN, cname, "Cannot join channel; unable to determine if you are an SSL user (+z is set)");
                                return MOD_RES_DENY;
                        }
 
                        if (!api->GetCertificate(user))
                        {
-                               user->WriteNumeric(ERR_SECUREONLYCHAN, cname, "Cannot join channel; SSL users only (+z)");
+                               user->WriteNumeric(ERR_SECUREONLYCHAN, cname, "Cannot join channel; SSL users only (+z is set)");
                                return MOD_RES_DENY;
                        }
                }
@@ -190,7 +195,7 @@ class ModuleSSLModes
                        if (!api || !api->GetCertificate(user))
                        {
                                /* The sending user is not on an SSL connection */
-                               user->WriteNumeric(ERR_CANTSENDTOUSER, target->nick, "You are not permitted to send private messages to this user (+z set)");
+                               user->WriteNumeric(ERR_CANTSENDTOUSER, target->nick, "You are not permitted to send private messages to this user (+z is set)");
                                return MOD_RES_DENY;
                        }
                }