- const std::string umodes = tag->getString("usermodes");
- for (std::string::const_iterator c = umodes.begin(); c != umodes.end(); ++c)
- {
- const char& chr = *c;
- if (chr == '*')
- this->AllowedUserModes.set();
- else if (ModeParser::IsModeChar(chr))
- this->AllowedUserModes[chr - 'A'] = true;
- }
-
- const std::string cmodes = tag->getString("chanmodes");
- for (std::string::const_iterator c = cmodes.begin(); c != cmodes.end(); ++c)
- {
- const char& chr = *c;
- if (chr == '*')
- this->AllowedChanModes.set();
- else if (ModeParser::IsModeChar(chr))
- this->AllowedChanModes[chr - 'A'] = true;
- }
-
- const std::string snomasks = tag->getString("snomasks", "*");
- for (std::string::const_iterator c = snomasks.begin(); c != snomasks.end(); ++c)
- {
- const char& chr = *c;
- if (chr == '*')
- this->AllowedSnomasks.set();
- else if (ModeParser::IsModeChar(chr))
- this->AllowedSnomasks[chr - 'A'] = true;
- }
+ ParseModeList(AllowedChanModes, tag, "chanmodes");
+ ParseModeList(AllowedUserModes, tag, "usermodes");
+ if (ParseModeList(AllowedSnomasks, tag, "snomasks"))
+ defaultsnomasks = false;