aboutsummaryrefslogtreecommitdiff
path: root/include/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2020-07-20 12:16:48 +0100
committerGravatar Sadie Powell2020-07-20 12:16:48 +0100
commit4e3d97546a5884b38a48303075a91c7485a6fae5 (patch)
treecff0d17e3243ed600e6a6b3c72a1041202262f6d /include/modules
parentPascalize ExtensionItem::{get,set,unset}_raw. (diff)
Pascalize Cap::set and rename Cap::get to IsEnabled.
Diffstat (limited to 'include/modules')
-rw-r--r--include/modules/cap.h8
-rw-r--r--include/modules/ircv3.h4
-rw-r--r--include/modules/ircv3_replies.h12
3 files changed, 12 insertions, 12 deletions
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);