summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-12-26 07:20:45 +0000
committertrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-12-26 07:20:45 +0000
commit0607b8c2b2a0510207a73320f4532844863ec9a0 (patch)
tree80b5c0b8886f3d10647b28350a3b5672ba40d0e1 /src
parent90974e3636f34fd3a9e49c37b8dae4a357ea070a (diff)
BUILD : 1.7.6 (504) BUGS : 245 NOTES : Enforce SGLINE/SQLINE where the ircd does not do it on its own, and updated ptlink support to be more complaint
git-svn-id: svn://svn.anope.org/anope/trunk@504 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@358 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/config.c4
-rw-r--r--src/operserv.c31
-rw-r--r--src/ptlink.c11
3 files changed, 41 insertions, 5 deletions
diff --git a/src/config.c b/src/config.c
index 80513547a..87c959a59 100644
--- a/src/config.c
+++ b/src/config.c
@@ -242,6 +242,8 @@ int SGLineExpiry;
int SQLineExpiry;
int SZLineExpiry;
int AkillOnAdd;
+int KillonSGline;
+int KillonSQline;
int WallOper;
int WallBadOS;
int WallOSGlobal;
@@ -475,6 +477,8 @@ Directive directives[] = {
{"KeepBackups", {{PARAM_INT, PARAM_RELOAD, &KeepBackups}}},
{"KeepLogs", {{PARAM_INT, PARAM_RELOAD, &KeepLogs}}},
{"KillClones", {{PARAM_SET, PARAM_FULLONLY, &KillClones}}},
+ {"KillonSGline", {{PARAM_SET, PARAM_RELOAD, &KillonSGline}}},
+ {"KillonSQline", {{PARAM_SET, PARAM_RELOAD, &KillonSQline}}},
{"AddAkiller", {{PARAM_SET, PARAM_RELOAD, &AddAkiller}}},
{"KillClonesAkillExpire",
{{PARAM_TIME, PARAM_RELOAD, &KillClonesAkillExpire}}},
diff --git a/src/operserv.c b/src/operserv.c
index 176eed93b..ab0e90ea9 100644
--- a/src/operserv.c
+++ b/src/operserv.c
@@ -2519,7 +2519,11 @@ int add_sgline(User * u, char *mask, const char *by, const time_t expires,
const char *reason)
{
int deleted = 0, i;
+ int x;
SXLine *entry;
+ User *u2;
+ char buf[BUFSIZE];
+ *buf = '\0';
/* Checks whether there is an SGLINE that already covers
* the one we want to add, and whether there are SGLINEs
@@ -2595,6 +2599,17 @@ int add_sgline(User * u, char *mask, const char *by, const time_t expires,
anope_cmd_sgline(entry->mask, entry->reason);
+ if (KillonSGline && !ircd->sglineenforce) {
+ for (x = 0; x < 1024; x++) {
+ for (u2 = userlist[x]; u2; u2 = u2->next) {
+ if (match_wild_nocase(entry->mask, u2->realname)) {
+ snprintf(buf, BUFSIZE - 1, "G-Lined: %s",
+ entry->reason);
+ kill_user(ServerName, u2->nick, buf);
+ }
+ }
+ }
+ }
return deleted;
}
@@ -2972,7 +2987,11 @@ int add_sqline(User * u, char *mask, const char *by, const time_t expires,
const char *reason)
{
int deleted = 0, i;
+ int x;
+ User *u2;
SXLine *entry;
+ char buf[BUFSIZE];
+ *buf = '\0';
/* Checks whether there is an SQLINE that already covers
* the one we want to add, and whether there are SQLINEs
@@ -3052,6 +3071,18 @@ int add_sqline(User * u, char *mask, const char *by, const time_t expires,
sqline(entry->mask, entry->reason);
+ if (KillonSQline) {
+ for (x = 0; x < 1024; x++) {
+ for (u2 = userlist[x]; u2; u2 = u2->next) {
+ if (match_wild_nocase(entry->mask, u2->nick)) {
+ snprintf(buf, BUFSIZE - 1, "Q-Lined: %s",
+ entry->reason);
+ kill_user(ServerName, u2->nick, buf);
+ }
+ }
+ }
+ }
+
return deleted;
}
diff --git a/src/ptlink.c b/src/ptlink.c
index 13941b221..098b5bf9f 100644
--- a/src/ptlink.c
+++ b/src/ptlink.c
@@ -591,7 +591,7 @@ int anope_event_capab(char *source, int ac, char **av)
*/
void anope_cmd_sqline(char *mask, char *reason)
{
- send_cmd(NULL, "SQLINE %s :%s", mask, reason);
+ send_cmd(ServerName, "SQLINE %s :%s", mask, reason);
}
/*
@@ -646,7 +646,8 @@ void anope_cmd_unsqline(char *user)
void anope_cmd_join(char *user, char *channel, time_t chantime)
{
- send_cmd(user, "JOIN %s", channel);
+ send_cmd(ServerName, "SJOIN %ld %s + :%s", (long int) time(null),
+ channel, user);
}
/*
@@ -1589,7 +1590,7 @@ void anope_cmd_chg_nick(char *oldnick, char *newnick)
return;
}
- send_cmd(oldnick, "NICK %s", newnick);
+ send_cmd(oldnick, "NICK %s %ld", newnick, (long int) time(null));
}
/*
@@ -1597,11 +1598,11 @@ void anope_cmd_chg_nick(char *oldnick, char *newnick)
parv[0] = sender (services client)
parv[1] = target client nick
parv[2] = channels list
- :ChanServ SVSJOIN mynick 4163321 #Chan1,#Chan2
+ :OperServ SVSJOIN Trystan #Admin
*/
void anope_cmd_svsjoin(char *source, char *nick, char *chan)
{
- send_cmd(source, "SVSJOIN %s :%s", nick, chan);
+ send_cmd(source, "SVSJOIN %s %s", nick, chan);
}
/*