diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-13 20:32:19 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-13 20:32:19 +0000 |
commit | ca1b136b306784191235a6579da59f7e862003d1 (patch) | |
tree | f81963f840d28e50566e05131009bee35a9208be | |
parent | 40dc59986b3991d3db3cb3a761aa9aa7bab69737 (diff) |
Fix GetPrefixChar returning empty if a non-prefix mode was used
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11706 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/channels.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 7f2cefd2b..0afbc93bb 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -914,7 +914,7 @@ const char* Channel::GetPrefixChar(User *user) { char mchar = m->second->modes[i]; ModeHandler* mh = ServerInstance->Modes->FindMode(mchar, MODETYPE_CHANNEL); - if (mh && mh->GetPrefixRank() > bestrank) + if (mh && mh->GetPrefixRank() > bestrank && mh->GetPrefix()) { bestrank = mh->GetPrefixRank(); pf[0] = mh->GetPrefix(); @@ -960,20 +960,10 @@ const char* Channel::GetAllPrefixChars(User* user) unsigned int Channel::GetPrefixValue(User* user) { - unsigned int bestrank = 0; - UserMembIter m = userlist.find(user); - if (m != userlist.end()) - { - for(unsigned int i=0; i < m->second->modes.length(); i++) - { - char mchar = m->second->modes[i]; - ModeHandler* mh = ServerInstance->Modes->FindMode(mchar, MODETYPE_CHANNEL); - if (mh && mh->GetPrefixRank() > bestrank) - bestrank = mh->GetPrefixRank(); - } - } - return bestrank; + if (m == userlist.end()) + return 0; + return m->second->getRank(); } void Channel::SetPrefix(User* user, char prefix, bool adding) |