diff --git a/Changes b/Changes index b5170b99a..ba9a87827 100644 --- a/Changes +++ b/Changes @@ -1642,3 +1642,5 @@ 'error setting max fd's to 9223372036854775807' which prevents the ircd from booting up. Reported by btcentral and Bock. This hack might not be totally correct though ;). +- Limit watch status requests to one per time, more will often flood you off + and is stupid/useless. diff --git a/src/modules/m_watch.c b/src/modules/m_watch.c index 65c2c3381..3095a94a4 100644 --- a/src/modules/m_watch.c +++ b/src/modules/m_watch.c @@ -136,7 +136,7 @@ DLLFUNC CMD_FUNC(m_watch) char *s, **pav = parv, *user; char *p = NULL, *def = "l"; int awaynotify = 0; - + int did_l=0, did_s=0; if (parc < 2) { @@ -212,12 +212,14 @@ DLLFUNC CMD_FUNC(m_watch) * their WATCH list. I imagine this could be CPU intensive if its * done alot, perhaps an auto-lag on this? */ - if (*s == 'S' || *s == 's') + if ((*s == 'S' || *s == 's') && !did_s) { Link *lp; aWatch *anptr; int count = 0; - + + did_s = 1; + /* * Send a list of how many users they have on their WATCH list * and how many WATCH lists they are on. @@ -274,10 +276,12 @@ DLLFUNC CMD_FUNC(m_watch) * their WATCH list AND if they are online or offline? Sheesh, * greedy arn't we? */ - if (*s == 'L' || *s == 'l') + if ((*s == 'L' || *s == 'l') && !did_l) { Link *lp = sptr->watch; + did_l = 1; + while (lp) { if ((acptr =