summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-12 14:49:30 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-12 14:49:30 +0000
commitced58c3be3f1da8dcf70c3904e5fe4bdaabf0e3d (patch)
treedfe3ef7f3758ba7ae95fd1ae70c93d26238b7917 /src
parent988568f3d1cc2247fa3adbadd8daa0ee175fcb1d (diff)
Renamed to chanrec::modes
Renamed IsCustomModeSet to IsModeSet GetModeParameter will now return the channel limit (as a string) for a request for mode 'l' and the channel key for a request for mode 'k'. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3692 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp31
-rw-r--r--src/cmd_invite.cpp2
-rw-r--r--src/cmd_list.cpp2
-rw-r--r--src/cmd_names.cpp2
-rw-r--r--src/cmd_notice.cpp4
-rw-r--r--src/cmd_privmsg.cpp4
-rw-r--r--src/cmd_topic.cpp4
-rw-r--r--src/message.cpp2
-rw-r--r--src/mode.cpp70
-rw-r--r--src/modules/m_blockcaps.cpp2
-rw-r--r--src/modules/m_blockcolor.cpp2
-rw-r--r--src/modules/m_censor.cpp2
-rw-r--r--src/modules/m_kicknorejoin.cpp2
-rw-r--r--src/modules/m_knock.cpp4
-rw-r--r--src/modules/m_noctcp.cpp2
-rw-r--r--src/modules/m_noinvite.cpp2
-rw-r--r--src/modules/m_nokicks.cpp2
-rw-r--r--src/modules/m_nonicks.cpp2
-rw-r--r--src/modules/m_nonotice.cpp2
-rw-r--r--src/modules/m_operchans.cpp2
-rw-r--r--src/modules/m_override.cpp2
-rw-r--r--src/modules/m_redirect.cpp4
-rw-r--r--src/modules/m_safelist.cpp2
-rw-r--r--src/modules/m_services.cpp4
-rw-r--r--src/modules/m_sslmodes.cpp2
-rw-r--r--src/modules/m_stripcolor.cpp2
-rw-r--r--src/modules/m_testcommand.cpp2
-rw-r--r--src/modules/m_uninvite.cpp2
28 files changed, 88 insertions, 77 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index aabf9664c..3f2eca3f5 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -73,12 +73,12 @@ chanrec::chanrec()
*name = *topic = *setby = *key = 0;
created = topicset = limit = 0;
internal_userlist.clear();
- memset(&custom_modes,0,64);
+ memset(&modes,0,64);
}
void chanrec::SetCustomMode(char mode,bool mode_on)
{
- custom_modes[mode-65] = mode_on;
+ modes[mode-65] = mode_on;
if (!mode_on)
this->SetCustomModeParam(mode,"",false);
}
@@ -108,19 +108,30 @@ void chanrec::SetCustomModeParam(char mode,char* parameter,bool mode_on)
}
}
-bool chanrec::IsCustomModeSet(char mode)
+bool chanrec::IsModeSet(char mode)
{
- return custom_modes[mode-65];
+ return modes[mode-65];
}
std::string chanrec::GetModeParameter(char mode)
{
- std::map<char,char*>::iterator n = custom_mode_params.find(mode);
- if (n != custom_mode_params.end())
+ if (mode == 'k')
{
- return n->second;
+ return this->key;
+ }
+ else if (mode == 'l')
+ {
+ return ConvToStr(this->limit);
+ }
+ else
+ {
+ std::map<char,char*>::iterator n = custom_mode_params.find(mode);
+ if (n != custom_mode_params.end())
+ {
+ return n->second;
+ }
+ return "";
}
- return "";
}
long chanrec::GetUserCounter()
@@ -254,7 +265,7 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri
/* create a new one */
chanlist[cname] = new chanrec();
strlcpy(chanlist[cname]->name, cname,CHANMAX);
- chanlist[cname]->custom_modes[CM_TOPICLOCK] = chanlist[cname]->custom_modes[CM_NOEXTERNAL] = 1;
+ chanlist[cname]->modes[CM_TOPICLOCK] = chanlist[cname]->modes[CM_NOEXTERNAL] = 1;
//chanlist[cname]->binarymodes = CM_TOPICLOCK | CM_NOEXTERNAL;
chanlist[cname]->created = TIME;
*chanlist[cname]->topic = 0;
@@ -312,7 +323,7 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri
}
}
}
- if (Ptr->custom_modes[CM_INVITEONLY])
+ if (Ptr->modes[CM_INVITEONLY])
{
MOD_RESULT = 0;
irc::string xname(Ptr->name);
diff --git a/src/cmd_invite.cpp b/src/cmd_invite.cpp
index 3dbabe859..33e61189d 100644
--- a/src/cmd_invite.cpp
+++ b/src/cmd_invite.cpp
@@ -64,7 +64,7 @@ void cmd_invite::Handle (char **parameters, int pcnt, userrec *user)
return;
}
- if ((c->custom_modes[CM_INVITEONLY]) && (IS_LOCAL(user)))
+ if ((c->modes[CM_INVITEONLY]) && (IS_LOCAL(user)))
{
if (cstatus(user,c) < STATUS_HOP)
{
diff --git a/src/cmd_list.cpp b/src/cmd_list.cpp
index 3b91d88e9..27a9ce44d 100644
--- a/src/cmd_list.cpp
+++ b/src/cmd_list.cpp
@@ -47,7 +47,7 @@ void cmd_list::Handle (char **parameters, int pcnt, userrec *user)
{
// if the channel is not private/secret, OR the user is on the channel anyway
bool n = i->second->HasUser(user);
- if (((!(i->second->custom_modes[CM_PRIVATE])) && (!(i->second->custom_modes[CM_SECRET]))) || (n))
+ if (((!(i->second->modes[CM_PRIVATE])) && (!(i->second->modes[CM_SECRET]))) || (n))
{
long users = usercount_i(i->second);
if (users)
diff --git a/src/cmd_names.cpp b/src/cmd_names.cpp
index 2eb046eac..e5e83a70f 100644
--- a/src/cmd_names.cpp
+++ b/src/cmd_names.cpp
@@ -76,7 +76,7 @@ void cmd_names::Handle (char **parameters, int pcnt, userrec *user)
c = FindChan(parameters[0]);
if (c)
{
- if ((c->custom_modes[CM_SECRET]) && (!c->HasUser(user)))
+ if ((c->modes[CM_SECRET]) && (!c->HasUser(user)))
{
WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, c->name);
return;
diff --git a/src/cmd_notice.cpp b/src/cmd_notice.cpp
index 6e894e6a4..1adb43923 100644
--- a/src/cmd_notice.cpp
+++ b/src/cmd_notice.cpp
@@ -94,12 +94,12 @@ void cmd_notice::Handle (char **parameters, int pcnt, userrec *user)
{
if (IS_LOCAL(user))
{
- if ((chan->custom_modes[CM_NOEXTERNAL]) && (!chan->HasUser(user)))
+ if ((chan->modes[CM_NOEXTERNAL]) && (!chan->HasUser(user)))
{
WriteServ(user->fd,"404 %s %s :Cannot send to channel (no external messages)", user->nick, chan->name);
return;
}
- if ((chan->custom_modes[CM_MODERATED]) && (cstatus(user,chan)<STATUS_VOICE))
+ if ((chan->modes[CM_MODERATED]) && (cstatus(user,chan)<STATUS_VOICE))
{
WriteServ(user->fd,"404 %s %s :Cannot send to channel (+m)", user->nick, chan->name);
return;
diff --git a/src/cmd_privmsg.cpp b/src/cmd_privmsg.cpp
index feed75293..f5adf14d0 100644
--- a/src/cmd_privmsg.cpp
+++ b/src/cmd_privmsg.cpp
@@ -94,12 +94,12 @@ void cmd_privmsg::Handle (char **parameters, int pcnt, userrec *user)
{
if (IS_LOCAL(user))
{
- if ((chan->custom_modes[CM_NOEXTERNAL]) && (!chan->HasUser(user)))
+ if ((chan->modes[CM_NOEXTERNAL]) && (!chan->HasUser(user)))
{
WriteServ(user->fd,"404 %s %s :Cannot send to channel (no external messages)", user->nick, chan->name);
return;
}
- if ((chan->custom_modes[CM_MODERATED]) && (cstatus(user,chan)<STATUS_VOICE))
+ if ((chan->modes[CM_MODERATED]) && (cstatus(user,chan)<STATUS_VOICE))
{
WriteServ(user->fd,"404 %s %s :Cannot send to channel (+m)", user->nick, chan->name);
return;
diff --git a/src/cmd_topic.cpp b/src/cmd_topic.cpp
index 37cfe035e..b8c60240d 100644
--- a/src/cmd_topic.cpp
+++ b/src/cmd_topic.cpp
@@ -70,7 +70,7 @@ void cmd_topic::Handle (char **parameters, int pcnt, userrec *user)
Ptr = FindChan(parameters[0]);
if (Ptr)
{
- if ((Ptr->custom_modes[CM_SECRET]) && (!Ptr->HasUser(user)))
+ if ((Ptr->modes[CM_SECRET]) && (!Ptr->HasUser(user)))
{
WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, Ptr->name);
return;
@@ -103,7 +103,7 @@ void cmd_topic::Handle (char **parameters, int pcnt, userrec *user)
WriteServ(user->fd,"442 %s %s :You're not on that channel!",user->nick, Ptr->name);
return;
}
- if ((Ptr->custom_modes[CM_TOPICLOCK]) && (cstatus(user,Ptr)<STATUS_HOP))
+ if ((Ptr->modes[CM_TOPICLOCK]) && (cstatus(user,Ptr)<STATUS_HOP))
{
WriteServ(user->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel", user->nick, Ptr->name);
return;
diff --git a/src/message.cpp b/src/message.cpp
index 87e23e501..0a41e5b8a 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -416,7 +416,7 @@ std::string chlist(userrec *user,userrec* source)
{
// if the channel is NOT private/secret, OR the source user is on the channel, AND the user is not invisible.
// if the user is the same as the source, shortcircuit the comparison.
- if ((source == user) || ((((!(((ucrec*)(*i))->channel->custom_modes[CM_PRIVATE])) && (!(((ucrec*)(*i))->channel->custom_modes[CM_SECRET])) && (!userinvisible)) || (((ucrec*)(*i))->channel->HasUser(source)))))
+ if ((source == user) || ((((!(((ucrec*)(*i))->channel->modes[CM_PRIVATE])) && (!(((ucrec*)(*i))->channel->modes[CM_SECRET])) && (!userinvisible)) || (((ucrec*)(*i))->channel->HasUser(source)))))
{
lst = lst + std::string(cmode(user,((ucrec*)(*i))->channel)) + std::string(((ucrec*)(*i))->channel->name) + " ";
}
diff --git a/src/mode.cpp b/src/mode.cpp
index fa3ccd88d..5d93eb161 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -653,7 +653,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
break;
previously_set_k = true;
- if (!chan->custom_modes[CM_KEY])
+ if (!chan->modes[CM_KEY])
{
MOD_RESULT = 0;
FOREACH_RESULT(I_OnRawMode,OnRawMode(user, chan, 'k', parameters[param], true, 1));
@@ -664,7 +664,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
strlcpy(key,parameters[param++],32);
outpars[pc++] = key;
strlcpy(chan->key,key,MAXBUF);
- chan->custom_modes[CM_KEY] = 1;
+ chan->modes[CM_KEY] = 1;
k_set = true;
}
else param++;
@@ -689,7 +689,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
{
*outl++ = 'k';
*chan->key = 0;
- chan->custom_modes[CM_KEY] = 0;
+ chan->modes[CM_KEY] = 0;
outpars[pc++] = key;
}
}
@@ -707,11 +707,11 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
FOREACH_RESULT(I_OnRawMode,OnRawMode(user, chan, 'l', "", false, 0));
if (!MOD_RESULT)
{
- if (chan->custom_modes[CM_LIMIT])
+ if (chan->modes[CM_LIMIT])
{
*outl++ = 'l';
chan->limit = 0;
- chan->custom_modes[CM_LIMIT] = 0;
+ chan->modes[CM_LIMIT] = 0;
}
}
}
@@ -756,7 +756,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
if (chan->limit)
{
*outl++ = 'l';
- chan->custom_modes[CM_LIMIT] = 1;
+ chan->modes[CM_LIMIT] = 1;
outpars[pc++] = parameters[param++];
l_set = true;
}
@@ -770,13 +770,13 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
{
if (mdir)
{
- if (!(chan->custom_modes[CM_INVITEONLY])) *outl++ = 'i';
- chan->custom_modes[CM_INVITEONLY] = 1;
+ if (!(chan->modes[CM_INVITEONLY])) *outl++ = 'i';
+ chan->modes[CM_INVITEONLY] = 1;
}
else
{
- if (chan->custom_modes[CM_INVITEONLY]) *outl++ = 'i';
- chan->custom_modes[CM_INVITEONLY] = 0;
+ if (chan->modes[CM_INVITEONLY]) *outl++ = 'i';
+ chan->modes[CM_INVITEONLY] = 0;
}
}
break;
@@ -788,13 +788,13 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
{
if (mdir)
{
- if (!(chan->custom_modes[CM_TOPICLOCK])) *outl++ = 't';
- chan->custom_modes[CM_TOPICLOCK] = 1;
+ if (!(chan->modes[CM_TOPICLOCK])) *outl++ = 't';
+ chan->modes[CM_TOPICLOCK] = 1;
}
else
{
- if (chan->custom_modes[CM_TOPICLOCK]) *outl++ = 't';
- chan->custom_modes[CM_TOPICLOCK] = 0;
+ if (chan->modes[CM_TOPICLOCK]) *outl++ = 't';
+ chan->modes[CM_TOPICLOCK] = 0;
}
}
break;
@@ -806,13 +806,13 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
{
if (mdir)
{
- if (!(chan->custom_modes[CM_NOEXTERNAL])) *outl++ = 'n';
- chan->custom_modes[CM_NOEXTERNAL] = 1;
+ if (!(chan->modes[CM_NOEXTERNAL])) *outl++ = 'n';
+ chan->modes[CM_NOEXTERNAL] = 1;
}
else
{
- if (chan->custom_modes[CM_NOEXTERNAL]) *outl++ = 'n';
- chan->custom_modes[CM_NOEXTERNAL] = 0;
+ if (chan->modes[CM_NOEXTERNAL]) *outl++ = 'n';
+ chan->modes[CM_NOEXTERNAL] = 0;
}
}
break;
@@ -824,13 +824,13 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
{
if (mdir)
{
- if (!(chan->custom_modes[CM_MODERATED])) *outl++ = 'm';
- chan->custom_modes[CM_MODERATED] = 1;
+ if (!(chan->modes[CM_MODERATED])) *outl++ = 'm';
+ chan->modes[CM_MODERATED] = 1;
}
else
{
- if (chan->custom_modes[CM_MODERATED]) *outl++ = 'm';
- chan->custom_modes[CM_MODERATED] = 0;
+ if (chan->modes[CM_MODERATED]) *outl++ = 'm';
+ chan->modes[CM_MODERATED] = 0;
}
}
break;
@@ -842,11 +842,11 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
{
if (mdir)
{
- if (!(chan->custom_modes[CM_SECRET])) *outl++ = 's';
- chan->custom_modes[CM_SECRET] = 1;
- if (chan->custom_modes[CM_PRIVATE])
+ if (!(chan->modes[CM_SECRET])) *outl++ = 's';
+ chan->modes[CM_SECRET] = 1;
+ if (chan->modes[CM_PRIVATE])
{
- chan->custom_modes[CM_PRIVATE] = 0;
+ chan->modes[CM_PRIVATE] = 0;
if (mdir)
{
*outl++ = '-'; *outl++ = 'p'; *outl++ = '+';
@@ -855,8 +855,8 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
}
else
{
- if (chan->custom_modes[CM_SECRET]) *outl++ = 's';
- chan->custom_modes[CM_SECRET] = 0;
+ if (chan->modes[CM_SECRET]) *outl++ = 's';
+ chan->modes[CM_SECRET] = 0;
}
}
break;
@@ -868,14 +868,14 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
{
if(mdir)
{
- if(!(chan->custom_modes[CM_PRIVATE]))
+ if(!(chan->modes[CM_PRIVATE]))
*outl++ = 'p';
- chan->custom_modes[CM_PRIVATE] = 1;
+ chan->modes[CM_PRIVATE] = 1;
- if(chan->custom_modes[CM_SECRET])
+ if(chan->modes[CM_SECRET])
{
- chan->custom_modes[CM_SECRET] = 0;
+ chan->modes[CM_SECRET] = 0;
*outl++ = '-';
*outl++ = 's';
@@ -884,10 +884,10 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
}
else
{
- if(chan->custom_modes[CM_PRIVATE])
+ if(chan->modes[CM_PRIVATE])
*outl++ = 'p';
- chan->custom_modes[CM_PRIVATE] = 0;
+ chan->modes[CM_PRIVATE] = 0;
}
}
break;
@@ -895,7 +895,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
default:
string_list p;
p.clear();
- bool x = chan->custom_modes[*modechar-65];
+ bool x = chan->modes[*modechar-65];
if ((!x && !mdir) || (x && mdir))
{
if (!ModeIsListMode(*modechar,MT_CHANNEL))
diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp
index f7ee81fd5..3db5e1ba8 100644
--- a/src/modules/m_blockcaps.cpp
+++ b/src/modules/m_blockcaps.cpp
@@ -49,7 +49,7 @@ public:
{
chanrec* c = (chanrec*)dest;
- if (c->IsCustomModeSet('P'))
+ if (c->IsModeSet('P'))
{
char* i = (char*)text.c_str();
for (; *i; i++)
diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp
index de782cf19..8389984d8 100644
--- a/src/modules/m_blockcolor.cpp
+++ b/src/modules/m_blockcolor.cpp
@@ -52,7 +52,7 @@ class ModuleBlockColour : public Module
{
chanrec* c = (chanrec*)dest;
- if(c->IsCustomModeSet('c'))
+ if(c->IsModeSet('c'))
{
/* Replace a strlcpy(), which ran even when +c wasn't set, with this (no copies at all) -- Om */
for(unsigned int i = 0; i < text.length(); i++)
diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp
index e57d09c8c..03b4f0f9d 100644
--- a/src/modules/m_censor.cpp
+++ b/src/modules/m_censor.cpp
@@ -124,7 +124,7 @@ class ModuleCensor : public Module
else if (target_type == TYPE_CHANNEL)
{
chanrec* t = (chanrec*)dest;
- active = (t->IsCustomModeSet('G'));
+ active = (t->IsModeSet('G'));
}
if (active)
diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp
index 01373019c..18fd995ad 100644
--- a/src/modules/m_kicknorejoin.cpp
+++ b/src/modules/m_kicknorejoin.cpp
@@ -105,7 +105,7 @@ public:
virtual void OnUserKick(userrec* source, userrec* user, chanrec* chan, const std::string &reason)
{
- if (chan->IsCustomModeSet('J') && (source != user))
+ if (chan->IsModeSet('J') && (source != user))
{
delaylist* dl = (delaylist*)chan->GetExt("norejoinusers");
diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp
index 2e63e890b..9169cfd4c 100644
--- a/src/modules/m_knock.cpp
+++ b/src/modules/m_knock.cpp
@@ -40,7 +40,7 @@ class cmd_knock : public command_t
chanrec* c = Srv->FindChannel(parameters[0]);
std::string line = "";
- if (c->IsCustomModeSet('K'))
+ if (c->IsModeSet('K'))
{
WriteServ(user->fd,"480 %s :Can't KNOCK on %s, +K is set.",user->nick, c->name);
return;
@@ -52,7 +52,7 @@ class cmd_knock : public command_t
}
line = line + std::string(parameters[pcnt-1]);
- if (c->custom_modes[CM_INVITEONLY])
+ if (c->modes[CM_INVITEONLY])
{
WriteChannelWithServ((char*)Srv->GetServerName().c_str(),c,"NOTICE %s :User %s is KNOCKing on %s (%s)",c->name,user->nick,c->name,line.c_str());
WriteServ(user->fd,"NOTICE %s :KNOCKing on %s",user->nick,c->name);
diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp
index ab0808aa2..42d233002 100644
--- a/src/modules/m_noctcp.cpp
+++ b/src/modules/m_noctcp.cpp
@@ -57,7 +57,7 @@ class ModuleNoCTCP : public Module
if (target_type == TYPE_CHANNEL)
{
chanrec* c = (chanrec*)dest;
- if (c->IsCustomModeSet('C'))
+ if (c->IsModeSet('C'))
{
if ((text.length()) && (text[0] == '\1'))
{
diff --git a/src/modules/m_noinvite.cpp b/src/modules/m_noinvite.cpp
index 1d4d8fedd..a0caade2a 100644
--- a/src/modules/m_noinvite.cpp
+++ b/src/modules/m_noinvite.cpp
@@ -50,7 +50,7 @@ class ModuleNoInvite : public Module
virtual int OnUserPreInvite(userrec* user,userrec* dest,chanrec* channel)
{
- if (channel->IsCustomModeSet('V'))
+ if (channel->IsModeSet('V'))
{
WriteServ(user->fd,"492 %s %s :Can't invite %s to channel (+V set)",user->nick, channel->name, dest->nick);
return 1;
diff --git a/src/modules/m_nokicks.cpp b/src/modules/m_nokicks.cpp
index d5b99b388..be16da608 100644
--- a/src/modules/m_nokicks.cpp
+++ b/src/modules/m_nokicks.cpp
@@ -51,7 +51,7 @@ class ModuleNoKicks : public Module
{
if (access_type == AC_KICK)
{
- if (channel->IsCustomModeSet('Q'))
+ if (channel->IsModeSet('Q'))
{
if ((Srv->IsUlined(source->nick)) || (Srv->IsUlined(source->server)) || (!strcmp(source->server,"")))
{
diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp
index 94e0fe4b9..78d10db33 100644
--- a/src/modules/m_nonicks.cpp
+++ b/src/modules/m_nonicks.cpp
@@ -69,7 +69,7 @@ class ModuleNoNickChange : public Module
if (((ucrec*)(*i))->channel != NULL)
{
chanrec* curr = ((ucrec*)(*i))->channel;
- if ((curr->IsCustomModeSet('N')) && (!*user->oper))
+ if ((curr->IsModeSet('N')) && (!*user->oper))
{
// don't allow the nickchange, theyre on at least one channel with +N set
// and theyre not an oper
diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp
index 01c849e55..1e977d355 100644
--- a/src/modules/m_nonotice.cpp
+++ b/src/modules/m_nonotice.cpp
@@ -46,7 +46,7 @@ class ModuleNoNotice : public Module
if (target_type == TYPE_CHANNEL)
{
chanrec* c = (chanrec*)dest;
- if (c->IsCustomModeSet('T'))
+ if (c->IsModeSet('T'))
{
if ((Srv->IsUlined(user->server)) || (Srv->ChanMode(user,c) == "@") || (Srv->ChanMode(user,c) == "%"))
{
diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp
index 21e360b1d..7ff66bdb2 100644
--- a/src/modules/m_operchans.cpp
+++ b/src/modules/m_operchans.cpp
@@ -77,7 +77,7 @@ class ModuleOperChans : public Module
{
if (chan)
{
- if (chan->IsCustomModeSet('O'))
+ if (chan->IsModeSet('O'))
{
WriteServ(user->fd,"520 %s %s :Only IRC operators may join the channel %s (+O is set)",user->nick, chan->name,chan->name);
return 1;
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp
index b048f7493..f92bb9899 100644
--- a/src/modules/m_override.cpp
+++ b/src/modules/m_override.cpp
@@ -185,7 +185,7 @@ class ModuleOverride : public Module
{
if (chan)
{
- if ((chan->custom_modes[CM_INVITEONLY]) && (CanOverride(user,"INVITE")))
+ if ((chan->modes[CM_INVITEONLY]) && (CanOverride(user,"INVITE")))
{
if (NoisyOverride)
{
diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp
index a91ddef7f..799eb25de 100644
--- a/src/modules/m_redirect.cpp
+++ b/src/modules/m_redirect.cpp
@@ -57,7 +57,7 @@ class ModuleRedirect : public Module
if (c)
{
/* Fix by brain: Dont let a channel be linked to *itself* either */
- if ((c == target) || (c->IsCustomModeSet('L')))
+ if ((c == target) || (c->IsModeSet('L')))
{
WriteServ(user->fd,"690 %s :Circular redirection, mode +L to %s not allowed.",user->nick,params[0].c_str());
return 0;
@@ -83,7 +83,7 @@ class ModuleRedirect : public Module
{
if (chan)
{
- if (chan->IsCustomModeSet('L'))
+ if (chan->IsModeSet('L'))
{
if (Srv->CountUsers(chan) >= chan->limit)
{
diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp
index 90eb0d613..fb5513fe2 100644
--- a/src/modules/m_safelist.cpp
+++ b/src/modules/m_safelist.cpp
@@ -98,7 +98,7 @@ class ListTimer : public InspTimer
chan = Srv->GetChannelIndex(ld->list_position);
/* spool details */
bool has_user = (chan && chan->HasUser(u));
- if ((chan) && (((!(chan->custom_modes[CM_PRIVATE])) && (!(chan->custom_modes[CM_SECRET]))) || (has_user)))
+ if ((chan) && (((!(chan->modes[CM_PRIVATE])) && (!(chan->modes[CM_SECRET]))) || (has_user)))
{
/* Increment total plus linefeed */
long users = usercount_i(chan);
diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp
index ead96ae98..4d5183841 100644
--- a/src/modules/m_services.cpp
+++ b/src/modules/m_services.cpp
@@ -133,7 +133,7 @@ class ModuleServices : public Module
if (target_type == TYPE_CHANNEL)
{
chanrec* c = (chanrec*)dest;
- if ((c->IsCustomModeSet('M')) && (!strchr(user->modes,'r')))
+ if ((c->IsModeSet('M')) && (!strchr(user->modes,'r')))
{
if ((Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server)) || (!strcmp(user->server,"")))
{
@@ -172,7 +172,7 @@ class ModuleServices : public Module
{
if (chan)
{
- if (chan->IsCustomModeSet('R'))
+ if (chan->IsModeSet('R'))
{
if (!strchr(user->modes,'r'))
{
diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp
index 3ed40108d..ed9d55671 100644
--- a/src/modules/m_sslmodes.cpp
+++ b/src/modules/m_sslmodes.cpp
@@ -29,7 +29,7 @@ class ModuleSSLModes : public Module
virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
{
- if(chan && chan->IsCustomModeSet('z'))
+ if(chan && chan->IsModeSet('z'))
{
if(user->GetExt("ssl"))
{
diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp
index 19c69ec4b..22b1cf7e8 100644
--- a/src/modules/m_stripcolor.cpp
+++ b/src/modules/m_stripcolor.cpp
@@ -133,7 +133,7 @@ class ModuleStripColor : public Module
else if (target_type == TYPE_CHANNEL)
{
chanrec* t = (chanrec*)dest;
- active = (t->IsCustomModeSet('S'));
+ active = (t->IsModeSet('S'));
}
if (active)
{
diff --git a/src/modules/m_testcommand.cpp b/src/modules/m_testcommand.cpp
index ccb5bde6d..ceb0651d8 100644
--- a/src/modules/m_testcommand.cpp
+++ b/src/modules/m_testcommand.cpp
@@ -109,7 +109,7 @@ class ModuleTestCommand : public Module
virtual void OnUserJoin(userrec* user, chanrec* channel)
{
Srv->Log(DEBUG,"OnUserJoin triggered");
- if (channel->IsCustomModeSet('Z'))
+ if (channel->IsModeSet('Z'))
{
std::string param = channel->GetModeParameter('Z');
Srv->Log(DEBUG,"Custom mode is set on this channel! Parameter="+param);
diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp
index 07c01f058..07e975392 100644
--- a/src/modules/m_uninvite.cpp
+++ b/src/modules/m_uninvite.cpp
@@ -54,7 +54,7 @@ class cmd_uninvite : public command_t
return;
}
- if (c->custom_modes[CM_INVITEONLY])
+ if (c->modes[CM_INVITEONLY])
{
if (cstatus(user,c) < STATUS_HOP)
{