diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-01-12 20:50:21 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-01-12 20:50:21 +0000 |
commit | d50e771e368f31a82b70a4049f6d4b3f48e458e0 (patch) | |
tree | 74df437195749c62c330cfe3570c739c95b6e4bc | |
parent | 6c725e7a4f39d898024d85b3b93265d3172c5183 (diff) |
xline tweaks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2782 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/xline.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/xline.cpp b/src/xline.cpp index 3437fe0d9..4b782103b 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -649,14 +649,16 @@ void apply_lines(const int What) { char reason[MAXBUF]; char host[MAXBUF]; - + if ((!glines.size()) && (!klines.size()) && (!zlines.size()) && (!qlines.size()) && (!pglines.size()) && (!pklines.size()) && (!pzlines.size()) && (!pqlines.size())) return; CullList* Goners = new CullList(); - for (std::vector<userrec*>::const_iterator u = local_users.begin(); u != local_users.end(); u++) + char* check = NULL; + for (std::vector<userrec*>::const_iterator u2 = local_users.begin(); u2 != local_users.end(); u2++) { + userrec* u = (userrec*)(*u2); u->MakeHost(host); if (elines.size()) { @@ -666,38 +668,34 @@ void apply_lines(const int What) } if ((What & APPLY_GLINES) && (glines.size() || pglines.size())) { - char* check = matches_gline(host); - if (check) + if (check = matches_gline(host)) { snprintf(reason,MAXBUF,"G-Lined: %s",check); - Goners->AddItem(u->second,reason); + Goners->AddItem(u,reason); } } if ((What & APPLY_KLINES) && (klines.size() || pklines.size())) { - char* check = matches_kline(host); - if (check) + if (check = matches_kline(host)) { snprintf(reason,MAXBUF,"K-Lined: %s",check); - Goners->AddItem(u->second,reason); + Goners->AddItem(u,reason); } } if ((What & APPLY_QLINES) && (qlines.size() || pqlines.size())) { - char* check = matches_qline(u->second->nick); - if (check) + if (check = matches_qline(u->nick)) { snprintf(reason,MAXBUF,"Matched Q-Lined nick: %s",check); - Goners->AddItem(u->second,reason); + Goners->AddItem(u,reason); } } if ((What & APPLY_ZLINES) && (zlines.size() || pzlines.size())) { - char* check = matches_zline(u->second->ip); - if (check) + if (check = matches_zline(u->ip)) { - snprintf(reason,MAXBUF,"Z-Lined: %s",check); - Goners->AddItem(u->second,reason); + snprintf(reasonz,MAXBUF,"Z-Lined: %s",check); + Goners->AddItem(u,reason); } } } @@ -745,3 +743,4 @@ void stats_e(userrec* user) for (std::vector<ELine>::iterator i = pelines.begin(); i != pelines.end(); i++) WriteServ(user->fd,"223 %s :%s %d %d %s %s",user->nick,i->hostmask,i->set_time,i->duration,i->source,i->reason); } + |