summaryrefslogtreecommitdiff
path: root/src/xline.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-08 18:14:12 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-08 18:14:12 +0000
commit3b9cf59ba05e57fe16ff13b2782bc90e4a0685a5 (patch)
tree07351cd9350aa8a8e847f4c18fe868c4f6a89e14 /src/xline.cpp
parent1674c21da1f2539806250982dc91ac7ad8a24984 (diff)
Checks to not propogate invalid or already-existing Xlines
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3143 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/xline.cpp')
-rw-r--r--src/xline.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/xline.cpp b/src/xline.cpp
index bfffd0d84..97b28c24d 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -148,9 +148,9 @@ void read_xline_defaults()
// adds a g:line
-void add_gline(long duration, const char* source,const char* reason,const char* hostmask)
+bool add_gline(long duration, const char* source,const char* reason,const char* hostmask)
{
- del_gline(hostmask);
+ bool ret = del_gline(hostmask);
GLine item;
item.duration = duration;
strlcpy(item.hostmask,hostmask,199);
@@ -167,13 +167,14 @@ void add_gline(long duration, const char* source,const char* reason,const char*
{
pglines.push_back(item);
}
+ return !ret;
}
// adds an e:line (exception to bans)
-void add_eline(long duration, const char* source, const char* reason, const char* hostmask)
+bool add_eline(long duration, const char* source, const char* reason, const char* hostmask)
{
- del_eline(hostmask);
+ bool ret = del_eline(hostmask);
ELine item;
item.duration = duration;
strlcpy(item.hostmask,hostmask,199);
@@ -190,13 +191,14 @@ void add_eline(long duration, const char* source, const char* reason, const char
{
pelines.push_back(item);
}
+ return !ret;
}
// adds a q:line
-void add_qline(long duration, const char* source, const char* reason, const char* nickname)
+bool add_qline(long duration, const char* source, const char* reason, const char* nickname)
{
- del_qline(nickname);
+ bool ret = del_qline(nickname);
QLine item;
item.duration = duration;
strlcpy(item.nick,nickname,63);
@@ -214,13 +216,14 @@ void add_qline(long duration, const char* source, const char* reason, const char
{
pqlines.push_back(item);
}
+ return !ret;
}
// adds a z:line
-void add_zline(long duration, const char* source, const char* reason, const char* ipaddr)
+bool add_zline(long duration, const char* source, const char* reason, const char* ipaddr)
{
- del_zline(ipaddr);
+ bool ret = del_zline(ipaddr);
ZLine item;
item.duration = duration;
if (strchr(ipaddr,'@'))
@@ -244,13 +247,14 @@ void add_zline(long duration, const char* source, const char* reason, const char
{
pzlines.push_back(item);
}
+ return !ret;
}
// adds a k:line
-void add_kline(long duration, const char* source, const char* reason, const char* hostmask)
+bool add_kline(long duration, const char* source, const char* reason, const char* hostmask)
{
- del_kline(hostmask);
+ bool ret = del_kline(hostmask);
KLine item;
item.duration = duration;
strlcpy(item.hostmask,hostmask,200);
@@ -267,6 +271,7 @@ void add_kline(long duration, const char* source, const char* reason, const char
{
pklines.push_back(item);
}
+ return !ret;
}
// deletes a g:line, returns true if the line existed and was removed