X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fmodules%2Fcap.h;h=664120d39de1014a7e2399954bdf7325a4d30700;hb=d3a7ac87cb9ef8687f7fec09f54a570f9858efb4;hp=6dcb9f3bc4d037d5a9055cfe7472824e8adcb190;hpb=87b1461e2a4710a38b32186c2582da9fe9bb3804;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/modules/cap.h b/include/modules/cap.h index 6dcb9f3bc..664120d39 100644 --- a/include/modules/cap.h +++ b/include/modules/cap.h @@ -1,7 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2015 Attila Molnar + * Copyright (C) 2018-2019 Sadie Powell + * Copyright (C) 2015-2016, 2018 Attila Molnar * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -32,8 +33,9 @@ namespace Cap { public: ExtItem(Module* mod); - std::string serialize(SerializeFormat format, const Extensible* container, void* item) const CXX11_OVERRIDE; - void unserialize(SerializeFormat format, Extensible* container, const std::string& value) CXX11_OVERRIDE; + void FromInternal(Extensible* container, const std::string& value) CXX11_OVERRIDE; + std::string ToHuman(const Extensible* container, void* item) const CXX11_OVERRIDE; + std::string ToInternal(const Extensible* container, void* item) const CXX11_OVERRIDE; }; class Capability; @@ -302,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 @@ -318,7 +326,7 @@ namespace Cap { public: MessageBase(const std::string& subcmd) - : ClientProtocol::Message("CAP", ServerInstance->Config->ServerName) + : ClientProtocol::Message("CAP", ServerInstance->Config->GetServerName()) { PushParamPlaceholder(); PushParam(subcmd);