From: Sadie Powell Date: Tue, 19 Jan 2021 08:11:01 +0000 (+0000) Subject: Allow converting a Cap::Reference to a Cap::Capability*. X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=ebe3e3f3cfef79e5b92b4c1d8fc9913dac4ddf43;p=user%2Fhenk%2Fcode%2Finspircd.git Allow converting a Cap::Reference to a Cap::Capability*. --- diff --git a/include/modules/cap.h b/include/modules/cap.h index 9dacdc200..664120d39 100644 --- a/include/modules/cap.h +++ b/include/modules/cap.h @@ -304,6 +304,12 @@ namespace Cap { } + /** Retrieves the underlying cap. */ + operator const Cap::Capability*() const + { + return ref ? *ref : NULL; + } + /** Check whether a user has the referenced capability turned on. * @param user User to check * @return True if the user is using the referenced capability, false otherwise