From bccbe8fe3f707b9b810f8c31445e95d532f234d8 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 27 Sep 2006 07:36:36 +0000 Subject: Optimizations git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5347 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/channels.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src') 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::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; } -- cgit v1.2.3