From db7a49b071134cf3deadf05ce84fa6c7c46d80bf Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 31 Aug 2008 13:00:12 +0000 Subject: Move all the parameters around AGAIN. See docs shortly git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10364 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index b749b4788..5c06e8d08 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -158,16 +158,28 @@ void User::SetMode(unsigned char m, bool value) modes[m-65] = value; } -const char* User::FormatModes() +const char* User::FormatModes(bool showparameters) { static char data[MAXBUF]; + std::string params; int offset = 0; - for (int n = 0; n < 64; n++) + + for (unsigned char n = 0; n < 64; n++) { if (modes[n]) - data[offset++] = n+65; + { + data[offset++] = n + 65; + ModeHandler* mh = ServerInstance->Modes->FindMode(n + 65, MODETYPE_USER); + if (showparameters && mh && mh->GetNumParams(true)) + { + std::string p = mh->GetUserParameter(this); + if (p.length()) + params.append(" ").append(p); + } + } } data[offset] = 0; + strlcat(data, params.c_str(), MAXBUF); return data; } -- cgit v1.2.3