diff options
Diffstat (limited to 'src')
-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) |