From 4e3d97546a5884b38a48303075a91c7485a6fae5 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 20 Jul 2020 12:16:48 +0100 Subject: Pascalize Cap::set and rename Cap::get to IsEnabled. --- include/modules/cap.h | 8 ++++---- include/modules/ircv3.h | 4 ++-- include/modules/ircv3_replies.h | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'include/modules') diff --git a/include/modules/cap.h b/include/modules/cap.h index d5119b10f..ebcec651f 100644 --- a/include/modules/cap.h +++ b/include/modules/cap.h @@ -193,7 +193,7 @@ namespace Cap * @param user User to check * @return True if the user is using this capability, false otherwise */ - bool get(User* user) const + bool IsEnabled(User* user) const { if (!IsRegistered()) return false; @@ -205,7 +205,7 @@ namespace Cap * @param user User to turn the cap on/off for * @param val True to turn the cap on, false to turn it off */ - void set(User* user, bool val) + void Set(User* user, bool val) { if (!IsRegistered()) return; @@ -307,10 +307,10 @@ namespace Cap * @param user User to check * @return True if the user is using the referenced capability, false otherwise */ - bool get(LocalUser* user) + bool IsEnabled(LocalUser* user) { if (ref) - return ref->get(user); + return ref->IsEnabled(user); return false; } }; diff --git a/include/modules/ircv3.h b/include/modules/ircv3.h index 6f95ac20f..e00821a70 100644 --- a/include/modules/ircv3.h +++ b/include/modules/ircv3.h @@ -36,7 +36,7 @@ class IRCv3::WriteNeighborsWithCap : public User::ForEachNeighborHandler void Execute(LocalUser* user) override { - if (cap.get(user)) + if (cap.IsEnabled(user)) user->Send(protoev); } @@ -74,7 +74,7 @@ class IRCv3::CapTag : public ClientProtocol::MessageTagProvider bool ShouldSendTag(LocalUser* user, const ClientProtocol::MessageTagData& tagdata) override { - return cap.get(user); + return cap.IsEnabled(user); } void OnPopulateTags(ClientProtocol::Message& msg) override diff --git a/include/modules/ircv3_replies.h b/include/modules/ircv3_replies.h index 4666f002a..15b23c74a 100644 --- a/include/modules/ircv3_replies.h +++ b/include/modules/ircv3_replies.h @@ -180,7 +180,7 @@ class IRCv3::Replies::Reply void SendIfCap(LocalUser* user, const Cap::Capability& cap, Command* command, const std::string& code, const std::string& description) { - if (cap.get(user)) + if (cap.IsEnabled(user)) Send(user, command, code, description); else SendNoticeInternal(user, command, description); @@ -190,7 +190,7 @@ class IRCv3::Replies::Reply void SendIfCap(LocalUser* user, const Cap::Capability& cap, Command* command, const std::string& code, const T1& p1, const std::string& description) { - if (cap.get(user)) + if (cap.IsEnabled(user)) Send(user, command, code, p1, description); else SendNoticeInternal(user, command, description); @@ -200,7 +200,7 @@ class IRCv3::Replies::Reply void SendIfCap(LocalUser* user, const Cap::Capability& cap, Command* command, const std::string& code, const T1& p1, const T2& p2, const std::string& description) { - if (cap.get(user)) + if (cap.IsEnabled(user)) Send(user, command, code, p1, p2, description); else SendNoticeInternal(user, command, description); @@ -210,7 +210,7 @@ class IRCv3::Replies::Reply void SendIfCap(LocalUser* user, const Cap::Capability& cap, Command* command, const std::string& code, const T1& p1, const T2& p2, const T3& p3, const std::string& description) { - if (cap.get(user)) + if (cap.IsEnabled(user)) Send(user, command, code, p1, p2, p3, description); else SendNoticeInternal(user, command, description); @@ -220,7 +220,7 @@ class IRCv3::Replies::Reply void SendIfCap(LocalUser* user, const Cap::Capability& cap, Command* command, const std::string& code, const T1& p1, const T2& p2, const T3& p3, const T4& p4, const std::string& description) { - if (cap.get(user)) + if (cap.IsEnabled(user)) Send(user, command, code, p1, p2, p3, p4, description); else SendNoticeInternal(user, command, description); @@ -230,7 +230,7 @@ class IRCv3::Replies::Reply void SendIfCap(LocalUser* user, const Cap::Capability& cap, Command* command, const std::string& code, const T1& p1, const T2& p2, const T3& p3, const T4& p4, const T5& p5, const std::string& description) { - if (cap.get(user)) + if (cap.IsEnabled(user)) Send(user, command, code, p1, p2, p3, p4, p5, description); else SendNoticeInternal(user, command, description); -- cgit v1.3.1-10-gc9f91