diff options
author | jantje_85 <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-01-29 02:02:44 +0000 |
---|---|---|
committer | jantje_85 <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-01-29 02:02:44 +0000 |
commit | 308d7937ef6feb4dc543bd871979e03f1d6d6fd3 (patch) | |
tree | 6846770c6a0a93b7f9dac828654c4b50b1234d6d /src/channels.c | |
parent | 9c2591c20a27391ce5345f67252535d129168520 (diff) |
Bug 1001: Added support for internal tracking of +j channel mode (throttling).
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@1940 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/channels.c')
-rw-r--r-- | src/channels.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/channels.c b/src/channels.c index 97ba83d3b..f16c56388 100644 --- a/src/channels.c +++ b/src/channels.c @@ -445,6 +445,10 @@ void get_channel_stats(long *nrec, long *memuse) if (chan->redirect) mem += strlen(chan->redirect) + 1; } + if (ircd->jmode) { + if (chan->throttle) + mem += strlen(chan->throttle) + 1; + } mem += get_memuse(chan->bans); if (ircd->except) { mem += get_memuse(chan->excepts); @@ -1648,6 +1652,10 @@ void chan_delete(Channel * c) if (c->redirect) free(c->redirect); } + if (ircd->jmode) { + if (c->throttle) + free (c->throttle); + } if (c->bans && c->bans->count) { while (c->bans->entries) { @@ -1759,6 +1767,13 @@ char *get_flood(Channel * chan) /*************************************************************************/ +char *get_throttle(Channel * chan) +{ + return chan->throttle; +} + +/*************************************************************************/ + char *get_key(Channel * chan) { return chan->key; @@ -1825,6 +1840,19 @@ void set_flood(Channel * chan, char *value) /*************************************************************************/ +void chan_set_throttle(Channel * chan, char *value) +{ + if (chan->throttle) + free(chan->throttle); + chan->throttle = value ? sstrdup(value) : NULL; + + if (debug) + alog("debug: Throttle mode for channel %s set to %s", chan->name, + chan->throttle ? chan->throttle : "none"); +} + +/*************************************************************************/ + void chan_set_key(Channel * chan, char *value) { if (chan->key) |