mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
m_cap Add Capability::OnList() hook
This commit is contained in:
parent
53b9f55c18
commit
3e08629e83
@ -199,5 +199,15 @@ namespace Cap
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Called when a user requests a list of all capabilities and this capability is about to be included in the list.
|
||||
* The default behavior always includes the cap in the list.
|
||||
* @param user User querying a list capabilities
|
||||
* @return True to add this cap to the list sent to the user, false to not list it
|
||||
*/
|
||||
virtual bool OnList(LocalUser* user)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -149,6 +149,9 @@ class Cap::ManagerImpl : public Cap::Manager
|
||||
if (!(show_caps & cap->GetMask()))
|
||||
continue;
|
||||
|
||||
if ((show_all) && (!cap->OnList(user)))
|
||||
continue;
|
||||
|
||||
if (minus_prefix)
|
||||
out.push_back('-');
|
||||
out.append(cap->GetName()).push_back(' ');
|
||||
|
Loading…
x
Reference in New Issue
Block a user