summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-04-09 19:12:09 +0200
committerattilamolnar <attilamolnar@hush.com>2013-04-10 17:28:08 +0200
commitca0083cba90c8830f5018b73eb715665a8db9dd7 (patch)
tree20d335e4d7c2f886fbce00d494eead769d22c543 /src/modules
parent0f8f3af9accd4b2d2f17cd25dbb898187cc24c98 (diff)
Replace IS_AWAY() and IS_OPER() macros with User::IsAway() and User::IsOper()
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_alias.cpp2
-rw-r--r--src/modules/m_callerid.cpp2
-rw-r--r--src/modules/m_check.cpp4
-rw-r--r--src/modules/m_commonchans.cpp2
-rw-r--r--src/modules/m_denychans.cpp2
-rw-r--r--src/modules/m_filter.cpp2
-rw-r--r--src/modules/m_httpd_stats.cpp4
-rw-r--r--src/modules/m_ircv3.cpp4
-rw-r--r--src/modules/m_jumpserver.cpp2
-rw-r--r--src/modules/m_maphide.cpp2
-rw-r--r--src/modules/m_nonicks.cpp2
-rw-r--r--src/modules/m_operchans.cpp4
-rw-r--r--src/modules/m_operjoin.cpp2
-rw-r--r--src/modules/m_operlevels.cpp2
-rw-r--r--src/modules/m_operlog.cpp2
-rw-r--r--src/modules/m_operprefix.cpp2
-rw-r--r--src/modules/m_override.cpp8
-rw-r--r--src/modules/m_redirect.cpp2
-rw-r--r--src/modules/m_regonlycreate.cpp2
-rw-r--r--src/modules/m_restrictchans.cpp2
-rw-r--r--src/modules/m_restrictmsg.cpp2
-rw-r--r--src/modules/m_securelist.cpp2
-rw-r--r--src/modules/m_showwhois.cpp2
-rw-r--r--src/modules/m_shun.cpp2
-rw-r--r--src/modules/m_spanningtree/main.cpp12
-rw-r--r--src/modules/m_spanningtree/netburst.cpp4
-rw-r--r--src/modules/m_spanningtree/opertype.cpp2
-rw-r--r--src/modules/m_spanningtree/override_map.cpp8
-rw-r--r--src/modules/m_sslinfo.cpp4
-rw-r--r--src/modules/m_userip.cpp4
-rw-r--r--src/modules/m_watch.cpp4
31 files changed, 50 insertions, 50 deletions
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp
index 88c5ff9ca..cd53c9f97 100644
--- a/src/modules/m_alias.cpp
+++ b/src/modules/m_alias.cpp
@@ -263,7 +263,7 @@ class ModuleAlias : public Module
}
}
- if ((a->OperOnly) && (!IS_OPER(user)))
+ if ((a->OperOnly) && (!user->IsOper()))
return 0;
if (!a->RequiredNick.empty())
diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp
index 330b1ec91..ee7b5e71a 100644
--- a/src/modules/m_callerid.cpp
+++ b/src/modules/m_callerid.cpp
@@ -357,7 +357,7 @@ public:
if (!dest->IsModeSet('g'))
return MOD_RES_PASSTHRU;
- if (operoverride && IS_OPER(user))
+ if (operoverride && user->IsOper())
return MOD_RES_PASSTHRU;
callerid_data* dat = cmd.extInfo.get(dest, true);
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp
index 662e512f9..69389000b 100644
--- a/src/modules/m_check.cpp
+++ b/src/modules/m_check.cpp
@@ -102,14 +102,14 @@ class CommandCheck : public Command
if (loctarg)
user->SendText(checkstr + " lastmsg " + timestring(loctarg->idle_lastmsg));
- if (IS_AWAY(targuser))
+ if (targuser->IsAway())
{
/* user is away */
user->SendText(checkstr + " awaytime " + timestring(targuser->awaytime));
user->SendText(checkstr + " awaymsg " + targuser->awaymsg);
}
- if (IS_OPER(targuser))
+ if (targuser->IsOper())
{
OperInfo* oper = targuser->oper;
/* user is an oper of type ____ */
diff --git a/src/modules/m_commonchans.cpp b/src/modules/m_commonchans.cpp
index b7aa683e2..fad0dceca 100644
--- a/src/modules/m_commonchans.cpp
+++ b/src/modules/m_commonchans.cpp
@@ -54,7 +54,7 @@ class ModulePrivacyMode : public Module
if (target_type == TYPE_USER)
{
User* t = (User*)dest;
- if (!IS_OPER(user) && (t->IsModeSet('c')) && (!ServerInstance->ULine(user->server)) && !user->SharesChannelWith(t))
+ if (!user->IsOper() && (t->IsModeSet('c')) && (!ServerInstance->ULine(user->server)) && !user->SharesChannelWith(t))
{
user->WriteNumeric(ERR_CANTSENDTOUSER, "%s %s :You are not permitted to send private messages to this user (+c set)", user->nick.c_str(), t->nick.c_str());
return MOD_RES_DENY;
diff --git a/src/modules/m_denychans.cpp b/src/modules/m_denychans.cpp
index 50c70999d..9d9296c25 100644
--- a/src/modules/m_denychans.cpp
+++ b/src/modules/m_denychans.cpp
@@ -90,7 +90,7 @@ class ModuleDenyChannels : public Module
{
if (InspIRCd::Match(cname, j->second->getString("name")))
{
- if (IS_OPER(user) && j->second->getBool("allowopers"))
+ if (user->IsOper() && j->second->getBool("allowopers"))
{
return MOD_RES_PASSTHRU;
}
diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp
index 81457d40c..ffa94fea8 100644
--- a/src/modules/m_filter.cpp
+++ b/src/modules/m_filter.cpp
@@ -279,7 +279,7 @@ CmdResult CommandFilter::Handle(const std::vector<std::string> &parameters, User
bool ModuleFilter::AppliesToMe(User* user, FilterResult* filter, int iflags)
{
- if ((filter->flag_no_opers) && IS_OPER(user))
+ if ((filter->flag_no_opers) && user->IsOper())
return false;
if ((iflags & FLAG_PRIVMSG) && (!filter->flag_privmsg))
return false;
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp
index b3a13ada6..3af9ee754 100644
--- a/src/modules/m_httpd_stats.cpp
+++ b/src/modules/m_httpd_stats.cpp
@@ -187,9 +187,9 @@ class ModuleHttpStats : public Module
data << "<nickname>" << u->nick << "</nickname><uuid>" << u->uuid << "</uuid><realhost>"
<< u->host << "</realhost><displayhost>" << u->dhost << "</displayhost><gecos>"
<< Sanitize(u->fullname) << "</gecos><server>" << u->server << "</server>";
- if (IS_AWAY(u))
+ if (u->IsAway())
data << "<away>" << Sanitize(u->awaymsg) << "</away><awaytime>" << u->awaytime << "</awaytime>";
- if (IS_OPER(u))
+ if (u->IsOper())
data << "<opertype>" << Sanitize(u->oper->NameStr()) << "</opertype>";
data << "<modes>" << u->FormatModes() << "</modes><ident>" << Sanitize(u->ident) << "</ident>";
LocalUser* lu = IS_LOCAL(u);
diff --git a/src/modules/m_ircv3.cpp b/src/modules/m_ircv3.cpp
index b0e020c63..cc2e6c322 100644
--- a/src/modules/m_ircv3.cpp
+++ b/src/modules/m_ircv3.cpp
@@ -125,7 +125,7 @@ class ModuleIRCv3 : public Module
void OnUserJoin(Membership* memb, bool sync, bool created, CUList& excepts)
{
// Remember who is not going to see the JOIN because of other modules
- if ((awaynotify) && (IS_AWAY(memb->user)))
+ if ((awaynotify) && (memb->user->IsAway()))
last_excepts = excepts;
if (!extendedjoin)
@@ -212,7 +212,7 @@ class ModuleIRCv3 : public Module
void OnPostJoin(Membership *memb)
{
- if ((!awaynotify) || (!IS_AWAY(memb->user)))
+ if ((!awaynotify) || (!memb->user->IsAway()))
return;
std::string line = ":" + memb->user->GetFullHost() + " AWAY :" + memb->user->awaymsg;
diff --git a/src/modules/m_jumpserver.cpp b/src/modules/m_jumpserver.cpp
index 361a28c9f..b754b2960 100644
--- a/src/modules/m_jumpserver.cpp
+++ b/src/modules/m_jumpserver.cpp
@@ -102,7 +102,7 @@ class CommandJumpserver : public Command
for (LocalUserList::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); ++i)
{
User* t = *i;
- if (!IS_OPER(t))
+ if (!t->IsOper())
{
t->WriteNumeric(10, "%s %s %s :Please use this Server/Port instead", t->nick.c_str(), parameters[0].c_str(), parameters[1].c_str());
ServerInstance->Users->QuitUser(t, reason);
diff --git a/src/modules/m_maphide.cpp b/src/modules/m_maphide.cpp
index ca48cf4e2..f0502d175 100644
--- a/src/modules/m_maphide.cpp
+++ b/src/modules/m_maphide.cpp
@@ -39,7 +39,7 @@ class ModuleMapHide : public Module
ModResult OnPreCommand(std::string &command, std::vector<std::string> &parameters, LocalUser *user, bool validated, const std::string &original_line)
{
- if (validated && !IS_OPER(user) && !url.empty() && (command == "MAP" || command == "LINKS"))
+ if (validated && !user->IsOper() && !url.empty() && (command == "MAP" || command == "LINKS"))
{
user->WriteServ("NOTICE %s :/%s has been disabled; visit %s", user->nick.c_str(), command.c_str(), url.c_str());
return MOD_RES_DENY;
diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp
index ba60afc80..c1eb63da9 100644
--- a/src/modules/m_nonicks.cpp
+++ b/src/modules/m_nonicks.cpp
@@ -74,7 +74,7 @@ class ModuleNoNickChange : public Module
if (res == MOD_RES_ALLOW)
continue;
- if (override && IS_OPER(user))
+ if (override && user->IsOper())
continue;
if (!curr->GetExtBanStatus(user, 'N').check(!curr->IsModeSet('N')))
diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp
index 508b0ff0c..2ac98e90c 100644
--- a/src/modules/m_operchans.cpp
+++ b/src/modules/m_operchans.cpp
@@ -51,7 +51,7 @@ class ModuleOperChans : public Module
ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
- if (chan && chan->IsModeSet('O') && !IS_OPER(user))
+ if (chan && chan->IsModeSet('O') && !user->IsOper())
{
user->WriteNumeric(ERR_CANTJOINOPERSONLY, "%s %s :Only IRC operators may join %s (+O is set)",
user->nick.c_str(), chan->name.c_str(), chan->name.c_str());
@@ -64,7 +64,7 @@ class ModuleOperChans : public Module
{
if ((mask.length() > 2) && (mask[0] == 'O') && (mask[1] == ':'))
{
- if (IS_OPER(user) && InspIRCd::Match(user->oper->name, mask.substr(2)))
+ if (user->IsOper() && InspIRCd::Match(user->oper->name, mask.substr(2)))
return MOD_RES_DENY;
}
return MOD_RES_PASSTHRU;
diff --git a/src/modules/m_operjoin.cpp b/src/modules/m_operjoin.cpp
index ea70e51dc..2f5dda0ff 100644
--- a/src/modules/m_operjoin.cpp
+++ b/src/modules/m_operjoin.cpp
@@ -85,7 +85,7 @@ class ModuleOperjoin : public Module
if (ServerInstance->IsChannel(it->c_str(), ServerInstance->Config->Limits.ChanMax))
Channel::JoinUser(user, it->c_str(), override, "", false, ServerInstance->Time());
- std::string chanList = IS_OPER(user)->getConfig("autojoin");
+ std::string chanList = user->oper->getConfig("autojoin");
if (!chanList.empty())
{
std::vector<std::string> typechans;
diff --git a/src/modules/m_operlevels.cpp b/src/modules/m_operlevels.cpp
index 793fa070a..7f94b8a0d 100644
--- a/src/modules/m_operlevels.cpp
+++ b/src/modules/m_operlevels.cpp
@@ -40,7 +40,7 @@ class ModuleOperLevels : public Module
virtual ModResult OnKill(User* source, User* dest, const std::string &reason)
{
// oper killing an oper?
- if (IS_OPER(dest) && IS_OPER(source))
+ if (dest->IsOper() && source->IsOper())
{
std::string level = dest->oper->getConfig("level");
long dest_level = atol(level.c_str());
diff --git a/src/modules/m_operlog.cpp b/src/modules/m_operlog.cpp
index 023ff9419..4c67ea32b 100644
--- a/src/modules/m_operlog.cpp
+++ b/src/modules/m_operlog.cpp
@@ -52,7 +52,7 @@ class ModuleOperLog : public Module
if (!validated)
return MOD_RES_PASSTHRU;
- if ((IS_OPER(user)) && (IS_LOCAL(user)) && (user->HasPermission(command)))
+ if ((user->IsOper()) && (IS_LOCAL(user)) && (user->HasPermission(command)))
{
Command* thiscommand = ServerInstance->Parser->GetHandler(command);
if ((thiscommand) && (thiscommand->flags_needed == 'o'))
diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp
index c7f8b8fe6..0df2ac6d8 100644
--- a/src/modules/m_operprefix.cpp
+++ b/src/modules/m_operprefix.cpp
@@ -104,7 +104,7 @@ class ModuleOperPrefixMode : public Module
* conditions (mw_added and the user being +H) together mean the user is a hidden oper.
*/
- if (IS_OPER(user) && (!mw_added || !user->IsModeSet('H')))
+ if (user->IsOper() && (!mw_added || !user->IsModeSet('H')))
privs.push_back('y');
return MOD_RES_PASSTHRU;
}
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp
index 62fdfc8c9..81f4230eb 100644
--- a/src/modules/m_override.cpp
+++ b/src/modules/m_override.cpp
@@ -68,7 +68,7 @@ class ModuleOverride : public Module
ModResult OnPreTopicChange(User *source, Channel *channel, const std::string &topic)
{
- if (IS_LOCAL(source) && IS_OPER(source) && CanOverride(source, "TOPIC"))
+ if (IS_LOCAL(source) && source->IsOper() && CanOverride(source, "TOPIC"))
{
if (!channel->HasUser(source) || (channel->IsModeSet('t') && channel->GetPrefixValue(source) < HALFOP_VALUE))
{
@@ -84,7 +84,7 @@ class ModuleOverride : public Module
ModResult OnUserPreKick(User* source, Membership* memb, const std::string &reason)
{
- if (IS_OPER(source) && CanOverride(source,"KICK"))
+ if (source->IsOper() && CanOverride(source,"KICK"))
{
// If the kicker's status is less than the target's, or the kicker's status is less than or equal to voice
if ((memb->chan->GetPrefixValue(source) < memb->getRank()) || (memb->chan->GetPrefixValue(source) <= VOICE_VALUE))
@@ -100,7 +100,7 @@ class ModuleOverride : public Module
{
if (!source || !channel)
return MOD_RES_PASSTHRU;
- if (!IS_OPER(source) || !IS_LOCAL(source))
+ if (!source->IsOper() || !IS_LOCAL(source))
return MOD_RES_PASSTHRU;
unsigned int mode = channel->GetPrefixValue(source);
@@ -118,7 +118,7 @@ class ModuleOverride : public Module
ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
- if (IS_LOCAL(user) && IS_OPER(user))
+ if (IS_LOCAL(user) && user->IsOper())
{
if (chan)
{
diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp
index 318d26d2e..e2acb6af1 100644
--- a/src/modules/m_redirect.cpp
+++ b/src/modules/m_redirect.cpp
@@ -47,7 +47,7 @@ class Redirect : public ModeHandler
}
}
- if (IS_LOCAL(source) && !IS_OPER(source))
+ if (IS_LOCAL(source) && !source->IsOper())
{
Channel* c = ServerInstance->FindChan(parameter);
if (!c)
diff --git a/src/modules/m_regonlycreate.cpp b/src/modules/m_regonlycreate.cpp
index 22bf42a61..9d4cd5f60 100644
--- a/src/modules/m_regonlycreate.cpp
+++ b/src/modules/m_regonlycreate.cpp
@@ -39,7 +39,7 @@ class ModuleRegOnlyCreate : public Module
if (chan)
return MOD_RES_PASSTHRU;
- if (IS_OPER(user))
+ if (user->IsOper())
return MOD_RES_PASSTHRU;
if (user->IsModeSet('r'))
diff --git a/src/modules/m_restrictchans.cpp b/src/modules/m_restrictchans.cpp
index 09333bbc1..435738834 100644
--- a/src/modules/m_restrictchans.cpp
+++ b/src/modules/m_restrictchans.cpp
@@ -63,7 +63,7 @@ class ModuleRestrictChans : public Module
if (!chan)
{
// user is not an oper and its not in the allow list
- if ((!IS_OPER(user)) && (allowchans.find(x) == allowchans.end()))
+ if ((!user->IsOper()) && (allowchans.find(x) == allowchans.end()))
{
user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s %s :Only IRC operators may create new channels",user->nick.c_str(),cname.c_str());
return MOD_RES_DENY;
diff --git a/src/modules/m_restrictmsg.cpp b/src/modules/m_restrictmsg.cpp
index 33a7fb18a..c4eba1b2e 100644
--- a/src/modules/m_restrictmsg.cpp
+++ b/src/modules/m_restrictmsg.cpp
@@ -46,7 +46,7 @@ class ModuleRestrictMsg : public Module
// (1) the sender is opered
// (2) the recipient is opered
// anything else, blocked.
- if (IS_OPER(u) || IS_OPER(user))
+ if (u->IsOper() || user->IsOper())
{
return MOD_RES_PASSTHRU;
}
diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp
index 61e884314..fb841d81b 100644
--- a/src/modules/m_securelist.cpp
+++ b/src/modules/m_securelist.cpp
@@ -63,7 +63,7 @@ class ModuleSecureList : public Module
if (!validated)
return MOD_RES_PASSTHRU;
- if ((command == "LIST") && (ServerInstance->Time() < (user->signon+WaitTime)) && (!IS_OPER(user)))
+ if ((command == "LIST") && (ServerInstance->Time() < (user->signon+WaitTime)) && (!user->IsOper()))
{
/* Normally wouldnt be allowed here, are they exempt? */
for (std::vector<std::string>::iterator x = allowlist.begin(); x != allowlist.end(); x++)
diff --git a/src/modules/m_showwhois.cpp b/src/modules/m_showwhois.cpp
index 93c3a7e60..459e48664 100644
--- a/src/modules/m_showwhois.cpp
+++ b/src/modules/m_showwhois.cpp
@@ -108,7 +108,7 @@ class ModuleShowwhois : public Module
if (!dest->IsModeSet('W') || source == dest)
return;
- if (!ShowWhoisFromOpers && IS_OPER(source))
+ if (!ShowWhoisFromOpers && source->IsOper())
return;
if (IS_LOCAL(dest))
diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp
index 0638cb92d..cbaa68409 100644
--- a/src/modules/m_shun.cpp
+++ b/src/modules/m_shun.cpp
@@ -244,7 +244,7 @@ class ModuleShun : public Module
return MOD_RES_PASSTHRU;
}
- if (!affectopers && IS_OPER(user))
+ if (!affectopers && user->IsOper())
{
/* Don't do anything if the user is an operator and affectopers isn't set */
return MOD_RES_PASSTHRU;
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index e7892526e..97a57cc73 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -101,7 +101,7 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops)
{
if ((Current->GetChild(q)->Hidden) || ((Utils->HideULines) && (ServerInstance->ULine(Current->GetChild(q)->GetName()))))
{
- if (IS_OPER(user))
+ if (user->IsOper())
{
ShowLinks(Current->GetChild(q),user,hops+1);
}
@@ -112,16 +112,16 @@ void ModuleSpanningTree::ShowLinks(TreeServer* Current, User* user, int hops)
}
}
/* Don't display the line if its a uline, hide ulines is on, and the user isnt an oper */
- if ((Utils->HideULines) && (ServerInstance->ULine(Current->GetName())) && (!IS_OPER(user)))
+ if ((Utils->HideULines) && (ServerInstance->ULine(Current->GetName())) && (!user->IsOper()))
return;
/* Or if the server is hidden and they're not an oper */
- else if ((Current->Hidden) && (!IS_OPER(user)))
+ else if ((Current->Hidden) && (!user->IsOper()))
return;
std::string servername = Current->GetName();
user->WriteNumeric(364, "%s %s %s :%d %s", user->nick.c_str(), servername.c_str(),
- (Utils->FlatLinks && (!IS_OPER(user))) ? ServerInstance->Config->ServerName.c_str() : Parent.c_str(),
- (Utils->FlatLinks && (!IS_OPER(user))) ? 0 : hops,
+ (Utils->FlatLinks && (!user->IsOper())) ? ServerInstance->Config->ServerName.c_str() : Parent.c_str(),
+ (Utils->FlatLinks && (!user->IsOper())) ? 0 : hops,
Current->GetDesc().c_str());
}
@@ -595,7 +595,7 @@ void ModuleSpanningTree::OnUserConnect(LocalUser* user)
params.push_back(":"+user->fullname);
Utils->DoOneToMany(ServerInstance->Config->GetSID(), "UID", params);
- if (IS_OPER(user))
+ if (user->IsOper())
{
params.clear();
params.push_back(user->oper->name);
diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp
index 978886be6..6f32bb33e 100644
--- a/src/modules/m_spanningtree/netburst.cpp
+++ b/src/modules/m_spanningtree/netburst.cpp
@@ -238,12 +238,12 @@ void TreeSocket::SendUsers()
u->second->FormatModes(true), /* 8...n: Modes and params */
u->second->fullname.c_str()); /* size-1: GECOS */
this->WriteLine(data);
- if (IS_OPER(u->second))
+ if (u->second->IsOper())
{
snprintf(data,MAXBUF,":%s OPERTYPE %s", u->second->uuid.c_str(), u->second->oper->name.c_str());
this->WriteLine(data);
}
- if (IS_AWAY(u->second))
+ if (u->second->IsAway())
{
snprintf(data,MAXBUF,":%s AWAY %ld :%s", u->second->uuid.c_str(), (long)u->second->awaytime, u->second->awaymsg.c_str());
this->WriteLine(data);
diff --git a/src/modules/m_spanningtree/opertype.cpp b/src/modules/m_spanningtree/opertype.cpp
index 97a4de8c2..27c4271b8 100644
--- a/src/modules/m_spanningtree/opertype.cpp
+++ b/src/modules/m_spanningtree/opertype.cpp
@@ -30,7 +30,7 @@ CmdResult CommandOpertype::Handle(const std::vector<std::string>& params, User *
{
SpanningTreeUtilities* Utils = ((ModuleSpanningTree*)(Module*)creator)->Utils;
std::string opertype = params[0];
- if (!IS_OPER(u))
+ if (!u->IsOper())
ServerInstance->Users->all_opers.push_back(u);
u->modes[UM_OPERATOR] = 1;
OperIndex::iterator iter = ServerInstance->Config->oper_blocks.find(" " + opertype);
diff --git a/src/modules/m_spanningtree/override_map.cpp b/src/modules/m_spanningtree/override_map.cpp
index 04fa4bcab..69f088f65 100644
--- a/src/modules/m_spanningtree/override_map.cpp
+++ b/src/modules/m_spanningtree/override_map.cpp
@@ -51,7 +51,7 @@ void ModuleSpanningTree::ShowMap(TreeServer* Current, User* user, int depth, int
percent = Current->GetUserCount() * 100.0 / ServerInstance->Users->clientlist->size();
}
- const std::string operdata = IS_OPER(user) ? MapOperInfo(Current) : "";
+ const std::string operdata = user->IsOper() ? MapOperInfo(Current) : "";
char* myname = names + 100 * line;
char* mystat = stats + 50 * line;
@@ -59,7 +59,7 @@ void ModuleSpanningTree::ShowMap(TreeServer* Current, User* user, int depth, int
int w = depth;
std::string servername = Current->GetName();
- if (IS_OPER(user))
+ if (user->IsOper())
{
w += snprintf(myname + depth, 99 - depth, "%s (%s)", servername.c_str(), Current->GetID().c_str());
}
@@ -74,12 +74,12 @@ void ModuleSpanningTree::ShowMap(TreeServer* Current, User* user, int depth, int
line++;
- if (IS_OPER(user) || !Utils->FlatLinks)
+ if (user->IsOper() || !Utils->FlatLinks)
depth = depth + 2;
for (unsigned int q = 0; q < Current->ChildCount(); q++)
{
TreeServer* child = Current->GetChild(q);
- if (!IS_OPER(user)) {
+ if (!user->IsOper()) {
if (child->Hidden)
continue;
if ((Utils->HideULines) && (ServerInstance->ULine(child->GetName())))
diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp
index bb30b76b5..a04a643a0 100644
--- a/src/modules/m_sslinfo.cpp
+++ b/src/modules/m_sslinfo.cpp
@@ -97,7 +97,7 @@ class CommandSSLInfo : public Command
return CMD_FAILURE;
}
bool operonlyfp = ServerInstance->Config->ConfValue("sslinfo")->getBool("operonly");
- if (operonlyfp && !IS_OPER(user) && target != user)
+ if (operonlyfp && !user->IsOper() && target != user)
{
user->WriteServ("NOTICE %s :*** You cannot view SSL certificate information for other users", user->nick.c_str());
return CMD_FAILURE;
@@ -152,7 +152,7 @@ class ModuleSSLInfo : public Module
{
ServerInstance->SendWhoisLine(source, dest, 671, "%s %s :is using a secure connection", source->nick.c_str(), dest->nick.c_str());
bool operonlyfp = ServerInstance->Config->ConfValue("sslinfo")->getBool("operonly");
- if ((!operonlyfp || source == dest || IS_OPER(source)) && !cert->fingerprint.empty())
+ if ((!operonlyfp || source == dest || source->IsOper()) && !cert->fingerprint.empty())
ServerInstance->SendWhoisLine(source, dest, 276, "%s %s :has client certificate fingerprint %s",
source->nick.c_str(), dest->nick.c_str(), cert->fingerprint.c_str());
}
diff --git a/src/modules/m_userip.cpp b/src/modules/m_userip.cpp
index 57e6eaaad..0a91a1b6e 100644
--- a/src/modules/m_userip.cpp
+++ b/src/modules/m_userip.cpp
@@ -43,8 +43,8 @@ class CommandUserip : public Command
User *u = ServerInstance->FindNick(parameters[i]);
if ((u) && (u->registered == REG_ALL))
{
- retbuf = retbuf + u->nick + (IS_OPER(u) ? "*" : "") + "=";
- if (IS_AWAY(u))
+ retbuf = retbuf + u->nick + (u->IsOper() ? "*" : "") + "=";
+ if (u->IsAway())
retbuf += "-";
else
retbuf += "+";
diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp
index 66570ae94..615cdf191 100644
--- a/src/modules/m_watch.cpp
+++ b/src/modules/m_watch.cpp
@@ -242,7 +242,7 @@ class CommandWatch : public Command
{
(*wl)[nick] = std::string(target->ident).append(" ").append(target->dhost).append(" ").append(ConvToStr(target->age));
user->WriteNumeric(604, "%s %s %s :is online",user->nick.c_str(), nick, (*wl)[nick].c_str());
- if (IS_AWAY(target))
+ if (target->IsAway())
{
user->WriteNumeric(609, "%s %s %s %s %lu :is away", user->nick.c_str(), target->nick.c_str(), target->ident.c_str(), target->dhost.c_str(), (unsigned long) target->awaytime);
}
@@ -320,7 +320,7 @@ class CommandWatch : public Command
{
user->WriteNumeric(604, "%s %s %s :is online", user->nick.c_str(), q->first.c_str(), q->second.c_str());
User *targ = ServerInstance->FindNick(q->first.c_str());
- if (IS_AWAY(targ))
+ if (targ->IsAway())
{
user->WriteNumeric(609, "%s %s %s %s %lu :is away", user->nick.c_str(), targ->nick.c_str(), targ->ident.c_str(), targ->dhost.c_str(), (unsigned long) targ->awaytime);
}