Convert received modes into roles and affiliations

This commit is contained in:
Florent Le Coz
2014-01-04 01:59:36 +01:00
parent baf03a7e20
commit e840704b58
11 changed files with 183 additions and 10 deletions
+20
View File
@@ -25,3 +25,23 @@ IrcUser::IrcUser(const std::string& name):
IrcUser(name, {})
{
}
void IrcUser::add_mode(const char mode)
{
this->modes.insert(mode);
}
void IrcUser::remove_mode(const char mode)
{
this->modes.erase(mode);
}
char IrcUser::get_most_significant_mode(const std::vector<char>& modes) const
{
for (const char mode: modes)
{
if (this->modes.find(mode) != this->modes.end())
return mode;
}
return 0;
}