summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_blockamsg.cpp4
-rw-r--r--src/modules/m_nonicks.cpp19
2 files changed, 10 insertions, 13 deletions
diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp
index b3136ee75..8af55de0f 100644
--- a/src/modules/m_blockamsg.cpp
+++ b/src/modules/m_blockamsg.cpp
@@ -121,8 +121,8 @@ public:
if((*c == ',') && *(c+1) && (*(c+1) == '#'))
targets++;
- for(unsigned int i = 0; i < user->chans.size(); i++)
- if(user->chans[i].channel)
+ for(std::vector<ucrec*>::iterator f = user->chans.begin(); f != user->chans.end(); f++)
+ if(((ucrec*)(*f))->channel)
userchans++;
// Check that this message wasn't already sent within a few seconds.
diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp
index 5f7be1580..a252dc6da 100644
--- a/src/modules/m_nonicks.cpp
+++ b/src/modules/m_nonicks.cpp
@@ -64,20 +64,17 @@ class ModuleNoNickChange : public Module
irc::string me = Srv->GetServerName().c_str();
if (server == me)
{
- for (unsigned int i =0; i < user->chans.size(); i++)
+ for (std::vector<ucrec*>::iterator i = user->chans.begin(); i != user->chans.end(); i++)
{
- if (user->chans[i].channel != NULL)
+ if (((ucrec*)(*i))->channel != NULL)
{
- chanrec* curr = user->chans[i].channel;
- if (curr->IsCustomModeSet('N'))
+ chanrec* curr = ((ucrec*)(*i))->channel;
+ if ((curr->IsCustomModeSet('N')) && (!*user->oper))
{
- if (!*user->oper)
- {
- // don't allow the nickchange, theyre on at least one channel with +N set
- // and theyre not an oper
- WriteServ(user->fd,"447 %s :Can't change nickname while on %s (+N is set)",user->nick,curr->name);
- return 1;
- }
+ // don't allow the nickchange, theyre on at least one channel with +N set
+ // and theyre not an oper
+ WriteServ(user->fd,"447 %s :Can't change nickname while on %s (+N is set)",user->nick,curr->name);
+ return 1;
}
}
}