diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-08-31 13:00:12 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-08-31 13:00:12 +0000 |
commit | db7a49b071134cf3deadf05ce84fa6c7c46d80bf (patch) | |
tree | 3b87b2d2b4866fc1fa23910c212e645e8b0608ea /src/users.cpp | |
parent | c6ca1cd62688c3a012b138ad33131a700fe7bbc5 (diff) |
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
Diffstat (limited to 'src/users.cpp')
-rw-r--r-- | src/users.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
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; } |