summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-27 07:36:36 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-27 07:36:36 +0000
commitbccbe8fe3f707b9b810f8c31445e95d532f234d8 (patch)
tree098a6406e85ffd10285f9fa5e59d310b3abfea1c
parent08f11b64233b42dc8e3b8fbd9e91c8bbeb3cd8eb (diff)
Optimizations
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5347 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/channels.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 6f5d45df4..353798e96 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -583,14 +583,7 @@ long chanrec::KickUser(userrec *src, userrec *user, const char* reason)
int us = this->GetStatus(user);
if ((them < STATUS_HOP) || (them < us))
{
- if (them == STATUS_HOP)
- {
- src->WriteServ("482 %s %s :You must be a channel operator",src->nick, this->name);
- }
- else
- {
- src->WriteServ("482 %s %s :You must be at least a half-operator",src->nick, this->name);
- }
+ src->WriteServ("482 %s %s :You must be a channel %soperator",src->nick, this->name, them == STATUS_HOP ? "" : "half-");
return this->GetUserCounter();
}
}
@@ -760,7 +753,7 @@ char* chanrec::ChanModes(bool showkey)
*scratch = '\0';
*sparam = '\0';
- /* This was still iterating up to 190, chanrec::custom_modes is only 64 elements -- Om */
+ /* This was still iterating up to 190, chanrec::modes is only 64 elements -- Om */
for(int n = 0; n < 64; n++)
{
if(this->modes[n])
@@ -810,6 +803,9 @@ void chanrec::UserList(userrec *user)
size_t dlen, curlen;
int MOD_RESULT = 0;
+ if (!IS_LOCAL(user))
+ return;
+
FOREACH_RESULT(I_OnUserList,OnUserList(user, this));
ServerInstance->Log(DEBUG,"MOD_RESULT for UserList = %d",MOD_RESULT);
if (MOD_RESULT == 1)
@@ -872,11 +868,9 @@ void chanrec::UserList(userrec *user)
long chanrec::GetMaxBans()
{
- std::string x;
for (std::map<std::string,int>::iterator n = ServerInstance->Config->maxbans.begin(); n != ServerInstance->Config->maxbans.end(); n++)
{
- x = n->first;
- if (match(this->name,x.c_str()))
+ if (match(this->name,n->first.c_str()))
{
return n->second;
}