From ced58c3be3f1da8dcf70c3904e5fe4bdaabf0e3d Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 12 Mar 2006 14:49:30 +0000 Subject: 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 --- src/modules/m_blockcaps.cpp | 2 +- src/modules/m_blockcolor.cpp | 2 +- src/modules/m_censor.cpp | 2 +- src/modules/m_kicknorejoin.cpp | 2 +- src/modules/m_knock.cpp | 4 ++-- src/modules/m_noctcp.cpp | 2 +- src/modules/m_noinvite.cpp | 2 +- src/modules/m_nokicks.cpp | 2 +- src/modules/m_nonicks.cpp | 2 +- src/modules/m_nonotice.cpp | 2 +- src/modules/m_operchans.cpp | 2 +- src/modules/m_override.cpp | 2 +- src/modules/m_redirect.cpp | 4 ++-- src/modules/m_safelist.cpp | 2 +- src/modules/m_services.cpp | 4 ++-- src/modules/m_sslmodes.cpp | 2 +- src/modules/m_stripcolor.cpp | 2 +- src/modules/m_testcommand.cpp | 2 +- src/modules/m_uninvite.cpp | 2 +- 19 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src/modules') 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) { -- cgit v1.2.3