summaryrefslogtreecommitdiff
path: root/src/xline.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-12 20:25:51 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-12 20:25:51 +0000
commit6c725e7a4f39d898024d85b3b93265d3172c5183 (patch)
tree041a5e0eeda2cefcbc3ddc5826ff0c5ba30331b3 /src/xline.cpp
parent8aa7f73bd76d5faacbfef59b308de7314d926fbf (diff)
Replaced sprintf's with some char* voodoo
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2781 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/xline.cpp')
-rw-r--r--src/xline.cpp73
1 files changed, 35 insertions, 38 deletions
diff --git a/src/xline.cpp b/src/xline.cpp
index 4a7cfdea5..3437fe0d9 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -55,6 +55,7 @@ extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
extern ServerConfig* Config;
extern user_hash clientlist;
+extern std::vector<userrec*> local_users;
/* Version two, now with optimized expiry!
*
@@ -654,53 +655,49 @@ void apply_lines(const int What)
return;
CullList* Goners = new CullList();
-
- for (user_hash::const_iterator u = clientlist.begin(); u != clientlist.end(); u++)
+ for (std::vector<userrec*>::const_iterator u = local_users.begin(); u != local_users.end(); u++)
{
- if (u->second->fd > -1)
+ u->MakeHost(host);
+ if (elines.size())
{
- snprintf(host,MAXBUF,"%s@%s",u->second->ident,u->second->host);
- if (elines.size())
- {
- // ignore people matching exempts
- if (matches_exception(host))
- continue;
- }
- if ((What & APPLY_GLINES) && (glines.size() || pglines.size()))
+ // ignore people matching exempts
+ if (matches_exception(host))
+ continue;
+ }
+ if ((What & APPLY_GLINES) && (glines.size() || pglines.size()))
+ {
+ char* check = matches_gline(host);
+ if (check)
{
- char* check = matches_gline(host);
- if (check)
- {
- snprintf(reason,MAXBUF,"G-Lined: %s",check);
- Goners->AddItem(u->second,reason);
- }
+ snprintf(reason,MAXBUF,"G-Lined: %s",check);
+ Goners->AddItem(u->second,reason);
}
- if ((What & APPLY_KLINES) && (klines.size() || pklines.size()))
+ }
+ if ((What & APPLY_KLINES) && (klines.size() || pklines.size()))
+ {
+ char* check = matches_kline(host);
+ if (check)
{
- char* check = matches_kline(host);
- if (check)
- {
- snprintf(reason,MAXBUF,"K-Lined: %s",check);
- Goners->AddItem(u->second,reason);
- }
+ snprintf(reason,MAXBUF,"K-Lined: %s",check);
+ Goners->AddItem(u->second,reason);
}
- if ((What & APPLY_QLINES) && (qlines.size() || pqlines.size()))
+ }
+ if ((What & APPLY_QLINES) && (qlines.size() || pqlines.size()))
+ {
+ char* check = matches_qline(u->second->nick);
+ if (check)
{
- char* check = matches_qline(u->second->nick);
- if (check)
- {
- snprintf(reason,MAXBUF,"Matched Q-Lined nick: %s",check);
- Goners->AddItem(u->second,reason);
- }
+ snprintf(reason,MAXBUF,"Matched Q-Lined nick: %s",check);
+ Goners->AddItem(u->second,reason);
}
- if ((What & APPLY_ZLINES) && (zlines.size() || pzlines.size()))
+ }
+ if ((What & APPLY_ZLINES) && (zlines.size() || pzlines.size()))
+ {
+ char* check = matches_zline(u->second->ip);
+ if (check)
{
- char* check = matches_zline(u->second->ip);
- if (check)
- {
- snprintf(reason,MAXBUF,"Z-Lined: %s",check);
- Goners->AddItem(u->second,reason);
- }
+ snprintf(reason,MAXBUF,"Z-Lined: %s",check);
+ Goners->AddItem(u->second,reason);
}
}
}