]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nationalchars.cpp
Sync helpop chmodes s and p with docs
[user/henk/code/inspircd.git] / src / modules / m_nationalchars.cpp
index 9a875fca2295f3b76143af73a82652d11cea4d32..c56dfe81cf848f5102e1d2e681c8b8630dc8ff1c 100644 (file)
@@ -2,15 +2,15 @@
  * InspIRCd -- Internet Relay Chat Daemon
  *
  *   Copyright (C) 2019 Matt Schatz <genius3000@g3k.solutions>
- *   Copyright (C) 2013, 2015, 2017, 2020 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2013, 2015, 2017, 2020-2021 Sadie Powell <sadie@witchery.services>
  *   Copyright (C) 2012-2016 Attila Molnar <attilamolnar@hush.com>
  *   Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
  *   Copyright (C) 2011 jackmcbarn <jackmcbarn@inspircd.org>
  *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2009-2010 Craig Edwards <brain@inspircd.org>
  *   Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
  *   Copyright (C) 2009 Robin Burchell <robin+git@viroteck.net>
  *   Copyright (C) 2009 Dennis Friis <peavey@inspircd.org>
- *   Copyright (C) 2009 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
@@ -40,7 +40,6 @@ class lwbNickHandler
        static bool Call(const std::string&);
 };
 
-                                                                /*,m_reverse_additionalUp[256];*/
 static unsigned char m_reverse_additional[256],m_additionalMB[256],m_additionalUtf8[256],m_additionalUtf8range[256],m_additionalUtf8interval[256];
 
 char utf8checkrest(unsigned char * mb, unsigned char cnt)
@@ -274,7 +273,7 @@ class ModuleNationalChars : public Module
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("nationalchars");
                charset = tag->getString("file");
-               std::string casemapping = tag->getString("casemapping", FileSystem::GetFileName(charset));
+               std::string casemapping = tag->getString("casemapping", FileSystem::GetFileName(charset), 1);
                if (casemapping.find(' ') != std::string::npos)
                        throw ModuleException("<nationalchars:casemapping> must not contain any spaces!");
                ServerInstance->Config->CaseMapping = casemapping;
@@ -323,7 +322,7 @@ class ModuleNationalChars : public Module
 
        Version GetVersion() CXX11_OVERRIDE
        {
-               return Version("Provides an ability to have non-RFC1459 nicks & support for national CASEMAPPING", VF_VENDOR | VF_COMMON);
+               return Version("Allows the server administrator to define what characters are allowed in nicknames and channel names and how those characters should be compared in a case insensitive way.", VF_VENDOR | VF_COMMON);
        }
 
        /*make an array to check against it 8bit characters a bit faster. Whether allowed or uppercase (for your needs).*/
@@ -417,7 +416,7 @@ class ModuleNationalChars : public Module
                                        if (*p == '0')
                                        {
                                                if (p[1] == 'x')
-                                                        /* hex with the leading "0x" */
+                                                       /* hex with the leading "0x" */
                                                        chartable[i] = symtoi(p + 2, 16);
                                                else
                                                        chartable[i] = symtoi(p + 1, 8);
@@ -426,12 +425,13 @@ class ModuleNationalChars : public Module
                                        else if (*p == 'x')
                                        {
                                                chartable[i] = symtoi(p + 1, 16);
-                                       }else    /* decimal form */
+                                       }
+                                       else /* decimal form */
                                        {
                                                chartable[i] = symtoi(p, 10);
                                        }
                                }
-                               else             /* plain-text char between '' */
+                               else /* plain-text char between '' */
                                {
                                        if (*(p + 1) == '\\')
                                        {