mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 18:49:03 -04:00
Return std::string from Membership::GetAllPrefixChars()
This commit is contained in:
parent
1def7fd7f4
commit
6a35f493f3
@ -110,5 +110,5 @@ class CoreExport Membership : public Extensible, public insp::intrusive_list_nod
|
|||||||
* be in rank order, greatest first, as certain IRC clients require
|
* be in rank order, greatest first, as certain IRC clients require
|
||||||
* this when multiple prefixes are used names lists.
|
* this when multiple prefixes are used names lists.
|
||||||
*/
|
*/
|
||||||
const char* GetAllPrefixChars() const;
|
std::string GetAllPrefixChars() const;
|
||||||
};
|
};
|
||||||
|
@ -611,20 +611,17 @@ unsigned int Membership::getRank()
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* Membership::GetAllPrefixChars() const
|
std::string Membership::GetAllPrefixChars() const
|
||||||
{
|
{
|
||||||
static char prefix[64];
|
std::string ret;
|
||||||
int ctr = 0;
|
|
||||||
|
|
||||||
for (std::string::const_iterator i = modes.begin(); i != modes.end(); ++i)
|
for (std::string::const_iterator i = modes.begin(); i != modes.end(); ++i)
|
||||||
{
|
{
|
||||||
PrefixMode* mh = ServerInstance->Modes->FindPrefixMode(*i);
|
PrefixMode* mh = ServerInstance->Modes->FindPrefixMode(*i);
|
||||||
if (mh && mh->GetPrefix())
|
if (mh && mh->GetPrefix())
|
||||||
prefix[ctr++] = mh->GetPrefix();
|
ret.push_back(mh->GetPrefix());
|
||||||
}
|
}
|
||||||
prefix[ctr] = 0;
|
|
||||||
|
|
||||||
return prefix;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int Channel::GetPrefixValue(User* user)
|
unsigned int Channel::GetPrefixValue(User* user)
|
||||||
|
@ -264,7 +264,7 @@ class CommandCheck : public Command
|
|||||||
*/
|
*/
|
||||||
const UserManager::CloneCounts& clonecount = ServerInstance->Users->GetCloneCounts(i->first);
|
const UserManager::CloneCounts& clonecount = ServerInstance->Users->GetCloneCounts(i->first);
|
||||||
context.Write("member", InspIRCd::Format("%-3u %s%s (%s@%s) %s ", clonecount.global,
|
context.Write("member", InspIRCd::Format("%-3u %s%s (%s@%s) %s ", clonecount.global,
|
||||||
i->second->GetAllPrefixChars(), i->first->nick.c_str(),
|
i->second->GetAllPrefixChars().c_str(), i->first->nick.c_str(),
|
||||||
i->first->ident.c_str(), i->first->dhost.c_str(), i->first->fullname.c_str()));
|
i->first->ident.c_str(), i->first->dhost.c_str(), i->first->fullname.c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user