diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-01 13:53:27 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-01 13:53:27 +0000 |
commit | 1f9ef4081211739c7c04211a9d77549d25c09f7a (patch) | |
tree | d7bc1589bb5fd322016cb0dc8ae7da930b56cbdd /src/channels.cpp | |
parent | beaaee86df1e13f68fc5d6fb1f0ce61e3d3412a9 (diff) |
Configurable prefixes for chanmodes +qa: prefixes can be turned on or off individually and seperately, per server as well as per mode, and prefixes are no longer limited to ~&. *** SERVICES AUTHORS *** This involves a protocol change. FJOIN now sends the userlist with format modes,nick instead of prefixes,nick.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9241 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r-- | src/channels.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 15288ef09..dd41d1344 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -980,6 +980,7 @@ const char* Channel::GetPrefixChar(User *user) return pf; } + const char* Channel::GetAllPrefixChars(User* user) { static char prefix[MAXBUF]; @@ -1000,6 +1001,35 @@ const char* Channel::GetAllPrefixChars(User* user) return prefix; } + +const char* Channel::GetAllPrefixModes(User* user) +{ + static char prefix[MAXBUF]; + int ctr = 0; + *prefix = 0; + + prefixlist::iterator n = prefixes.find(user); + if (n != prefixes.end()) + { + for (std::vector<prefixtype>::iterator x = n->second.begin(); x != n->second.end(); x++) + { + ModeHandler *mh = ServerInstance->Modes->FindPrefix(x->first); + + if (!mh) + { + ServerInstance->Logs->Log("MODES", DEFAULT, "WTF: Can't find mode from prefix %c", x->first); + throw CoreException("I can't find a mode from prefix, HALP!"); + } + else + prefix[ctr++] = mh->GetModeChar(); + } + } + + prefix[ctr] = 0; + + return prefix; +} + unsigned int Channel::GetPrefixValue(User* user) { prefixlist::iterator n = prefixes.find(user); |