summaryrefslogtreecommitdiff
path: root/src/modes
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes')
-rw-r--r--src/modes/cmode_b.cpp10
-rw-r--r--src/modes/cmode_h.cpp4
-rw-r--r--src/modes/cmode_o.cpp4
-rw-r--r--src/modes/cmode_v.cpp4
-rw-r--r--src/modes/umode_n.cpp2
-rw-r--r--src/modes/umode_o.cpp4
6 files changed, 14 insertions, 14 deletions
diff --git a/src/modes/cmode_b.cpp b/src/modes/cmode_b.cpp
index d6495313a..92001b7fd 100644
--- a/src/modes/cmode_b.cpp
+++ b/src/modes/cmode_b.cpp
@@ -81,15 +81,15 @@ void ModeChannelBan::DisplayList(User* user, Channel* channel)
/* Display the channel banlist */
for (BanList::reverse_iterator i = channel->bans.rbegin(); i != channel->bans.rend(); ++i)
{
- user->WriteServ("367 %s %s %s %s %lu",user->nick, channel->name, i->data, i->set_by, (unsigned long)i->set_time);
+ user->WriteServ("367 %s %s %s %s %lu",user->nick.c_str(), channel->name, i->data, i->set_by, (unsigned long)i->set_time);
}
- user->WriteServ("368 %s %s :End of channel ban list",user->nick, channel->name);
+ user->WriteServ("368 %s %s :End of channel ban list",user->nick.c_str(), channel->name);
return;
}
void ModeChannelBan::DisplayEmptyList(User* user, Channel* channel)
{
- user->WriteServ("368 %s %s :End of channel ban list",user->nick, channel->name);
+ user->WriteServ("368 %s %s :End of channel ban list",user->nick.c_str(), channel->name);
}
std::string& ModeChannelBan::AddBan(User *user, std::string &dest, Channel *chan, int, bool servermode)
@@ -110,7 +110,7 @@ std::string& ModeChannelBan::AddBan(User *user, std::string &dest, Channel *chan
long maxbans = chan->GetMaxBans();
if ((unsigned)chan->bans.size() > (unsigned)maxbans)
{
- user->WriteServ("478 %s %s :Channel ban list for %s is full (maximum entries for this channel is %ld)",user->nick, chan->name,chan->name,maxbans);
+ user->WriteServ("478 %s %s :Channel ban list for %s is full (maximum entries for this channel is %ld)",user->nick.c_str(), chan->name,chan->name,maxbans);
dest = "";
return dest;
}
@@ -135,7 +135,7 @@ std::string& ModeChannelBan::AddBan(User *user, std::string &dest, Channel *chan
b.set_time = ServerInstance->Time();
strlcpy(b.data, dest.c_str(), MAXBUF);
- strlcpy(b.set_by, servermode ? ServerInstance->Config->ServerName : user->nick, 63);
+ strlcpy(b.set_by, servermode ? ServerInstance->Config->ServerName : user->nick.c_str(), 63);
chan->bans.push_back(b);
return dest;
}
diff --git a/src/modes/cmode_h.cpp b/src/modes/cmode_h.cpp
index 6dd941353..df27c3f50 100644
--- a/src/modes/cmode_h.cpp
+++ b/src/modes/cmode_h.cpp
@@ -125,7 +125,7 @@ std::string ModeChannelHalfOp::AddHalfOp(User *user,const char* dest,Channel *ch
{
if ((status < STATUS_OP) && (!ServerInstance->ULine(user->server)))
{
- user->WriteServ("482 %s %s :You're not a channel operator",user->nick, chan->name);
+ user->WriteServ("482 %s %s :You're not a channel operator",user->nick.c_str(), chan->name);
return "";
}
}
@@ -153,7 +153,7 @@ std::string ModeChannelHalfOp::DelHalfOp(User *user,const char *dest,Channel *ch
{
if ((user != d) && ((status < STATUS_OP) && (!ServerInstance->ULine(user->server))))
{
- user->WriteServ("482 %s %s :You are not a channel operator",user->nick, chan->name);
+ user->WriteServ("482 %s %s :You are not a channel operator",user->nick.c_str(), chan->name);
return "";
}
}
diff --git a/src/modes/cmode_o.cpp b/src/modes/cmode_o.cpp
index 0582dbee5..fe40adba6 100644
--- a/src/modes/cmode_o.cpp
+++ b/src/modes/cmode_o.cpp
@@ -114,7 +114,7 @@ std::string ModeChannelOp::AddOp(User *user,const char* dest,Channel *chan,int s
{
if ((status < STATUS_OP) && (!ServerInstance->ULine(user->server)))
{
- user->WriteServ("482 %s %s :You're not a channel operator",user->nick, chan->name);
+ user->WriteServ("482 %s %s :You're not a channel operator",user->nick.c_str(), chan->name);
return "";
}
}
@@ -142,7 +142,7 @@ std::string ModeChannelOp::DelOp(User *user,const char *dest,Channel *chan,int s
{
if ((status < STATUS_OP) && (!ServerInstance->ULine(user->server)) && (IS_LOCAL(user)))
{
- user->WriteServ("482 %s %s :You are not a channel operator",user->nick, chan->name);
+ user->WriteServ("482 %s %s :You are not a channel operator",user->nick.c_str(), chan->name);
return "";
}
}
diff --git a/src/modes/cmode_v.cpp b/src/modes/cmode_v.cpp
index 8e13ba6f1..7feb2efc2 100644
--- a/src/modes/cmode_v.cpp
+++ b/src/modes/cmode_v.cpp
@@ -114,7 +114,7 @@ std::string ModeChannelVoice::AddVoice(User *user,const char* dest,Channel *chan
{
if ((status < STATUS_HOP) && (!ServerInstance->ULine(user->server)))
{
- user->WriteServ("482 %s %s :You're not a channel (half)operator",user->nick, chan->name);
+ user->WriteServ("482 %s %s :You're not a channel (half)operator",user->nick.c_str(), chan->name);
return "";
}
}
@@ -142,7 +142,7 @@ std::string ModeChannelVoice::DelVoice(User *user,const char *dest,Channel *chan
{
if ((status < STATUS_HOP) && (!ServerInstance->ULine(user->server)))
{
- user->WriteServ("482 %s %s :You are not a channel (half)operator",user->nick, chan->name);
+ user->WriteServ("482 %s %s :You are not a channel (half)operator",user->nick.c_str(), chan->name);
return "";
}
}
diff --git a/src/modes/umode_n.cpp b/src/modes/umode_n.cpp
index fe75fd222..ed08b60f4 100644
--- a/src/modes/umode_n.cpp
+++ b/src/modes/umode_n.cpp
@@ -24,7 +24,7 @@ ModeUserServerNoticeMask::ModeUserServerNoticeMask(InspIRCd* Instance) : ModeHan
ModeAction ModeUserServerNoticeMask::OnModeChange(User* source, User* dest, Channel*, std::string &parameter, bool adding, bool servermode)
{
/* Only opers can change other users modes */
- if ((source != dest) && (!*source->oper))
+ if ((source != dest) && (!IS_OPER(source)))
return MODEACTION_DENY;
/* Set the array fields */
diff --git a/src/modes/umode_o.cpp b/src/modes/umode_o.cpp
index 17476c707..7cee7d238 100644
--- a/src/modes/umode_o.cpp
+++ b/src/modes/umode_o.cpp
@@ -24,7 +24,7 @@ ModeUserOperator::ModeUserOperator(InspIRCd* Instance) : ModeHandler(Instance, '
ModeAction ModeUserOperator::OnModeChange(User* source, User* dest, Channel*, std::string&, bool adding, bool servermode)
{
/* Only opers can execute this class at all */
- if (!*source->oper)
+ if (!IS_OPER(source))
return MODEACTION_DENY;
/* Not even opers can GIVE the +o mode, only take it away */
@@ -37,7 +37,7 @@ ModeAction ModeUserOperator::OnModeChange(User* source, User* dest, Channel*, st
* verifying as an oper and getting an opertype assigned
* to your User!
*/
- ServerInstance->SNO->WriteToSnoMask('o', "User %s de-opered (by %s)", dest->nick, source->nick);
+ ServerInstance->SNO->WriteToSnoMask('o', "User %s de-opered (by %s)", dest->nick.c_str(), source->nick.c_str());
dest->UnOper();
return MODEACTION_ALLOW;