diff options
| author | 2008-08-31 13:00:12 +0000 | |
|---|---|---|
| committer | 2008-08-31 13:00:12 +0000 | |
| commit | db7a49b071134cf3deadf05ce84fa6c7c46d80bf (patch) | |
| tree | 3b87b2d2b4866fc1fa23910c212e645e8b0608ea /src/users.cpp | |
| parent | Two fixes: First, change the error message for too few params for UID to now ... (diff) | |
| download | inspircd++-db7a49b071134cf3deadf05ce84fa6c7c46d80bf.tar.gz inspircd++-db7a49b071134cf3deadf05ce84fa6c7c46d80bf.tar.bz2 inspircd++-db7a49b071134cf3deadf05ce84fa6c7c46d80bf.zip | |
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; } |
