summaryrefslogtreecommitdiff
path: root/src/modes
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-19 21:16:42 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-19 21:16:42 +0000
commit31f1e7ad092f8bf16ee653cc105eea4a769650ca (patch)
treedced0411d5fbe803fe92ea54cb03d36c0a817563 /src/modes
parent869bd02318d94a38369a125726b8edeb54ba0706 (diff)
Convert channel::name to std::string, this was a beastie!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9770 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modes')
-rw-r--r--src/modes/cmode_b.cpp8
-rw-r--r--src/modes/cmode_h.cpp4
-rw-r--r--src/modes/cmode_k.cpp16
-rw-r--r--src/modes/cmode_o.cpp4
-rw-r--r--src/modes/cmode_v.cpp4
5 files changed, 18 insertions, 18 deletions
diff --git a/src/modes/cmode_b.cpp b/src/modes/cmode_b.cpp
index 0811538f1..157b3b35c 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.c_str(), channel->name, i->data.c_str(), i->set_by.c_str(), (unsigned long)i->set_time);
+ user->WriteServ("367 %s %s %s %s %lu",user->nick.c_str(), channel->name.c_str(), i->data.c_str(), i->set_by.c_str(), (unsigned long)i->set_time);
}
- user->WriteServ("368 %s %s :End of channel ban list",user->nick.c_str(), channel->name);
+ user->WriteServ("368 %s %s :End of channel ban list",user->nick.c_str(), channel->name.c_str());
return;
}
void ModeChannelBan::DisplayEmptyList(User* user, Channel* channel)
{
- user->WriteServ("368 %s %s :End of channel ban list",user->nick.c_str(), channel->name);
+ user->WriteServ("368 %s %s :End of channel ban list",user->nick.c_str(), channel->name.c_str());
}
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.c_str(), 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.c_str(), chan->name.c_str(), maxbans);
dest = "";
return dest;
}
diff --git a/src/modes/cmode_h.cpp b/src/modes/cmode_h.cpp
index df27c3f50..580eee443 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.c_str(), chan->name);
+ user->WriteServ("482 %s %s :You're not a channel operator",user->nick.c_str(), chan->name.c_str());
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.c_str(), chan->name);
+ user->WriteServ("482 %s %s :You are not a channel operator",user->nick.c_str(), chan->name.c_str());
return "";
}
}
diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp
index 0ab35b954..4d4453d44 100644
--- a/src/modes/cmode_k.cpp
+++ b/src/modes/cmode_k.cpp
@@ -63,31 +63,31 @@ bool ModeChannelKey::CheckTimeStamp(time_t, time_t, const std::string &their_par
ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding, bool servermode)
{
- if ((channel->modes[CM_KEY] != adding) || (!IS_LOCAL(source)))
+ if ((channel->IsModeSet('k') != adding) || (!IS_LOCAL(source)))
{
- if (((channel->modes[CM_KEY]) && (strcasecmp(parameter.c_str(),channel->key))) && (IS_LOCAL(source)))
+ if (((channel->IsModeSet('k')) && (parameter != channel->key)) && (IS_LOCAL(source)))
{
/* Key is currently set and the correct key wasnt given */
return MODEACTION_DENY;
}
- else if ((!channel->modes[CM_KEY]) || ((adding) && (!IS_LOCAL(source))))
+ else if ((!channel->IsModeSet('k')) || ((adding) && (!IS_LOCAL(source))))
{
/* Key isnt currently set */
if ((parameter.length()) && (parameter.rfind(' ') == std::string::npos))
{
- strlcpy(channel->key,parameter.c_str(),32);
- channel->modes[CM_KEY] = adding;
+ channel->key.assign(parameter, 0, 32);
+ channel->SetMode('k', adding);
parameter = channel->key;
return MODEACTION_ALLOW;
}
else
return MODEACTION_DENY;
}
- else if (((channel->modes[CM_KEY]) && (!strcasecmp(parameter.c_str(),channel->key))) || ((!adding) && (!IS_LOCAL(source))))
+ else if (((channel->IsModeSet('k')) && (parameter == channel->key)) || ((!adding) && (!IS_LOCAL(source))))
{
/* Key is currently set, and correct key was given */
- *channel->key = 0;
- channel->modes[CM_KEY] = adding;
+ channel->key.clear();
+ channel->SetMode('k', adding);
return MODEACTION_ALLOW;
}
return MODEACTION_DENY;
diff --git a/src/modes/cmode_o.cpp b/src/modes/cmode_o.cpp
index fe40adba6..cc555dd36 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.c_str(), chan->name);
+ user->WriteServ("482 %s %s :You're not a channel operator",user->nick.c_str(), chan->name.c_str());
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.c_str(), chan->name);
+ user->WriteServ("482 %s %s :You are not a channel operator",user->nick.c_str(), chan->name.c_str());
return "";
}
}
diff --git a/src/modes/cmode_v.cpp b/src/modes/cmode_v.cpp
index 7feb2efc2..1a04393d9 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.c_str(), chan->name);
+ user->WriteServ("482 %s %s :You're not a channel (half)operator",user->nick.c_str(), chan->name.c_str());
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.c_str(), chan->name);
+ user->WriteServ("482 %s %s :You are not a channel (half)operator",user->nick.c_str(), chan->name.c_str());
return "";
}
}