diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-23 21:09:49 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-23 21:09:49 +0000 |
commit | 594d430ee457b621c731a6cc70d84c02c295d59c (patch) | |
tree | afc623183cb5f239afcb2050087611b992ee0b87 /src/mode.cpp | |
parent | 1b87725fef508089024ffaf3d7dd0818c1c9a417 (diff) |
More prefixchar stuff.
WARNING: 005 numeric is broken in this commit.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5000 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/mode.cpp')
-rw-r--r-- | src/mode.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index 790720c6b..301fbc872 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -642,6 +642,30 @@ std::string ModeParser::ParaModeList() return modestr; } +bool ModeParser::PrefixComparison(const prefixtype one, const prefixtype two) +{ + return (one.second) < (two.second); +} + +std::string ModeParser::BuildPrefixes() +{ + std::string mletters = ""; + std::string mprefixes = ""; + pfxcontainer pfx; + + for (unsigned char mode = 'A'; mode <= 'z'; mode++) + { + unsigned char pos = (mode-65) | MASK_CHANNEL; + + if ((modehandlers[pos]) && (modehandlers[pos]->GetPrefix())) + pfx.push_back(std::make_pair<char,unsigned int>(modehandlers[pos]->GetPrefix(), modehandlers[pos]->GetPrefixRank())); + } + + sort(pfx.begin(), pfx.end(), ModeParser::PrefixComparison); + + return ""; +} + bool ModeParser::AddModeWatcher(ModeWatcher* mw) { unsigned char mask = 0; |