diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-02-26 11:48:09 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-02-26 11:48:09 +0000 |
commit | e2e581f0d3d5d844dc4b5210f566e5a5571a0570 (patch) | |
tree | 7e20006a6f4795a1fdf5e853dbe7a0941f917b32 /src/modules/m_remove.cpp | |
parent | 3c24bb87211772859b6a9b74aefa85d57b07dfa7 (diff) |
Server* Srv marked static or moved to private member of module class in all modules, paves way for removal of static-build-munging-regexp that breaks +eI
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3330 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_remove.cpp')
-rw-r--r-- | src/modules/m_remove.cpp | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index afd02d0f9..2c7fd8b9d 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -17,24 +17,33 @@ using namespace std; * eg: +h can remove +hv and users with no modes. +a can remove +aohv and users with no modes. */ -Server *Srv; +static Server *Srv; /* This little function just converts a chanmode character (~ & @ & +) into an integer (5 4 3 2 1) */ /* XXX - this could be handy in the core, so it can be used elsewhere */ -int chartolevel(std::string privs) -{ - /* XXX - if we just passed this a char, we could do a switch. Look nicer, really. */ - - if (privs == "~") - return 5; - else if (privs == "&") - return 4; - else if (privs == "@") - return 3; - else if (privs == "%") - return 2; - else - return 1; +int chartolevel(std::string &privs) +{1 + const char* n = privs.c_str(); + + switch (*n) + { + case '~': + return 5; + break; + case '&': + return 4; + break; + case '@': + return 3; + break; + case '%': + return 2; + break; + default: + return 1; + break; + } + return 1; } class cmd_remove : public command_t |