summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/users.cpp b/src/users.cpp
index d1b9945b9..9e4b935fc 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -705,6 +705,22 @@ void User::SetModesInternal(const char *umodes, ...)
}
}
+Anope::string User::GetModes() const
+{
+ Anope::string ret;
+
+ for (size_t i = UMODE_BEGIN + 1; i < UMODE_END; ++i)
+ if (this->modes.HasFlag(static_cast<UserModeName>(i)))
+ {
+ UserMode *um = ModeManager::FindUserModeByName(static_cast<UserModeName>(i));
+ if (um == NULL)
+ continue;
+ ret += um->ModeChar;
+ }
+
+ return ret;
+}
+
/** Find the channel container for Channel c that the user is on
* This is preferred over using FindUser in Channel, as there are usually more users in a channel
* than channels a user is in