]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Allow converting a Cap::Reference to a Cap::Capability*.
authorSadie Powell <sadie@witchery.services>
Tue, 19 Jan 2021 08:11:01 +0000 (08:11 +0000)
committerSadie Powell <sadie@witchery.services>
Tue, 19 Jan 2021 08:11:01 +0000 (08:11 +0000)
include/modules/cap.h

index 9dacdc200297f1d7b78c3108a3db7e78670818bd..664120d39de1014a7e2399954bdf7325a4d30700 100644 (file)
@@ -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