summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
authordrstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2008-02-05 19:16:42 +0000
committerdrstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2008-02-05 19:16:42 +0000
commit2a08701f557179d6a3787aae896d7dd9eb6e8982 (patch)
treeff5b7ef0575d94496e85256718da08cba4db84b2 /src/actions.c
parent1baff08ad8255b254149d456c632c853d3dc5c81 (diff)
BUILD : 1.7.21 (1374) BUGS : 820 NOTES : do_cmode() called without passing TS
git-svn-id: svn://svn.anope.org/anope/trunk@1374 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1089 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c38
1 files changed, 30 insertions, 8 deletions
diff --git a/src/actions.c b/src/actions.c
index 9d28c7311..d7c1ecda1 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -131,7 +131,9 @@ void sqline(char *mask, char *reason)
void common_unban(ChannelInfo * ci, char *nick)
{
int count, i;
- char *av[3], **bans;
+ char *av[4], **bans;
+ int ac;
+ char buf[BUFSIZE];
User *u;
char *host = NULL;
int matchfound = 0;
@@ -158,16 +160,29 @@ void common_unban(ChannelInfo * ci, char *nick)
if (ircd->svsmode_unban) {
anope_cmd_unban(ci->name, nick);
} else {
- av[0] = ci->name;
- av[1] = sstrdup("-b");
+ if (ircdcap->tsmode) {
+ snprintf(buf, BUFSIZE - 1, "%ld", (long int) time(NULL));
+ av[0] = ci->name;
+ av[1] = buf;
+ av[2] = sstrdup("-b");
+ ac = 4;
+ } else {
+ av[0] = ci->name;
+ av[1] = sstrdup("-b");
+ ac = 3;
+ }
count = ci->c->bancount;
bans = scalloc(sizeof(char *) * count, 1);
memcpy(bans, ci->c->bans, sizeof(char *) * count);
for (i = 0; i < count; i++) {
if (match_usermask(bans[i], u)) {
anope_cmd_mode(whosends(ci), ci->name, "-b %s", bans[i]);
- av[2] = bans[i];
- do_cmode(whosends(ci), 3, av);
+ if (ircdcap->tsmode)
+ av[3] = bans[i];
+ else
+ av[2] = bans[i];
+
+ do_cmode(whosends(ci), ac, av);
matchfound++;
}
if (host) {
@@ -182,15 +197,22 @@ void common_unban(ChannelInfo * ci, char *nick)
if (match_userip(bans[i], u, host)) {
anope_cmd_mode(whosends(ci), ci->name, "-b %s",
bans[i]);
- av[2] = bans[i];
- do_cmode(whosends(ci), 3, av);
+ if (ircdcap->tsmode)
+ av[3] = bans[i];
+ else
+ av[2] = bans[i];
+
+ do_cmode(whosends(ci), ac, av);
}
}
}
matchfound = 0;
}
free(bans);
- free(av[1]);
+ if (ircdcap->tsmode)
+ free(av[2]);
+ else
+ free(av[1]);
}
/* host_resolve() sstrdup us this info so we gotta free it */
if (host) {