summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp18
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;
}