From 8db52f66a2ff587457c34889b31e7ef70876c7fa Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Fri, 30 Dec 2016 18:51:56 +0100 Subject: Make all User::IsModeSet() methods const, accept const ModeHandler --- include/users.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/users.h b/include/users.h index 8cf78a585..29c573daa 100644 --- a/include/users.h +++ b/include/users.h @@ -427,10 +427,10 @@ class CoreExport User : public Extensible * @param m The user mode * @return True if the mode is set */ - bool IsModeSet(unsigned char m); - bool IsModeSet(ModeHandler* mh); - bool IsModeSet(ModeHandler& mh) { return IsModeSet(&mh); } - bool IsModeSet(UserModeReference& moderef); + bool IsModeSet(unsigned char m) const; + bool IsModeSet(const ModeHandler* mh) const; + bool IsModeSet(const ModeHandler& mh) const { return IsModeSet(&mh); } + bool IsModeSet(UserModeReference& moderef) const; /** Set a specific usermode to on or off * @param m The user mode @@ -924,12 +924,12 @@ inline FakeUser* IS_SERVER(User* u) return u->usertype == USERTYPE_SERVER ? static_cast(u) : NULL; } -inline bool User::IsModeSet(ModeHandler* mh) +inline bool User::IsModeSet(const ModeHandler* mh) const { return (modes[mh->GetId()]); } -inline bool User::IsModeSet(UserModeReference& moderef) +inline bool User::IsModeSet(UserModeReference& moderef) const { if (!moderef) return false; -- cgit v1.2.3