From 1a3f71be6037bb70a8027f7904fff8cea2d2e979 Mon Sep 17 00:00:00 2001 From: "drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Tue, 12 Feb 2008 17:44:54 +0000 Subject: BUILD : 1.7.21 (1387) BUGS : 869 NOTES : Added SUSPENDED to NS LIST keywords. git-svn-id: svn://svn.anope.org/anope/trunk@1387 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1102 5417fbe8-f217-4b02-8779-1006273d7864 --- src/core/ns_list.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/ns_list.c b/src/core/ns_list.c index 5cf00cfbb..6c6639f66 100644 --- a/src/core/ns_list.c +++ b/src/core/ns_list.c @@ -81,6 +81,8 @@ int do_list(User * u) * SADMINS will be shown forbidden nicks and the "!" indicator. * Syntax for sadmins: LIST pattern [FORBIDDEN] [NOEXPIRE] * -TheShadow + * + * UPDATE: SUSPENDED keyword is now accepted as well. */ @@ -94,6 +96,7 @@ int do_list(User * u) int16 matchflags = 0; NickRequest *nr = NULL; int nronly = 0; + int susp_keyword = 0; char noexpire_char = ' '; int count = 0, from = 0, to = 0, tofree = 0; char *tmp = NULL; @@ -152,6 +155,8 @@ int do_list(User * u) matchflags |= NS_VERBOTEN; if (stricmp(keyword, "NOEXPIRE") == 0) matchflags |= NS_NO_EXPIRE; + if (stricmp(keyword, "SUSPENDED") == 0) + susp_keyword = 1; if (stricmp(keyword, "UNCONFIRMED") == 0) nronly = 1; } @@ -168,7 +173,9 @@ int do_list(User * u) if ((na->nc->flags & NI_PRIVATE) && !is_servadmin && na->nc != mync) continue; - if ((matchflags != 0) && !(na->status & matchflags)) + if ((matchflags != 0) && !(na->status & matchflags) && (susp_keyword == 0)) + continue; + else if ((susp_keyword == 1) && !(na->nc->flags & NI_SUSPENDED)) continue; /* We no longer compare the pattern against the output buffer. @@ -198,6 +205,9 @@ int do_list(User * u) } else if (na->status & NS_VERBOTEN) { snprintf(buf, sizeof(buf), "%-20s [Forbidden]", na->nick); + } else if (na->nc->flags & NI_SUSPENDED) { + snprintf(buf, sizeof(buf), + "%-20s [Suspended]", na->nick); } else { snprintf(buf, sizeof(buf), "%-20s %s", na->nick, na->last_usermask); -- cgit