- /* Start with simple modes, no params */
- this->AddMode(new ModeChannelSecret, 's');
- this->AddMode(new ModeChannelPrivate, 'p');
- this->AddMode(new ModeChannelModerated, 'm');
- this->AddMode(new ModeChannelTopicOps, 't');
- this->AddMode(new ModeChannelNoExternal, 'n');
- this->AddMode(new ModeChannelInviteOnly, 'i');
+ /* Start with channel simple modes, no params */
+ this->AddMode(new ModeChannelSecret(Instance), 's');
+ this->AddMode(new ModeChannelPrivate(Instance), 'p');
+ this->AddMode(new ModeChannelModerated(Instance), 'm');
+ this->AddMode(new ModeChannelTopicOps(Instance), 't');
+ this->AddMode(new ModeChannelNoExternal(Instance), 'n');
+ this->AddMode(new ModeChannelInviteOnly(Instance), 'i');
+
+ /* Cannel modes with params */
+ this->AddMode(new ModeChannelKey(Instance), 'k');
+ this->AddMode(new ModeChannelLimit(Instance), 'l');
+
+ /* Channel listmodes */
+ this->AddMode(new ModeChannelBan(Instance), 'b');
+ this->AddMode(new ModeChannelOp(Instance), 'o');
+ this->AddMode(new ModeChannelHalfOp(Instance), 'h');
+ this->AddMode(new ModeChannelVoice(Instance), 'v');
+
+ /* Now for usermodes */
+ this->AddMode(new ModeUserServerNotice(Instance), 's');
+ this->AddMode(new ModeUserWallops(Instance), 'w');
+ this->AddMode(new ModeUserInvisible(Instance), 'i');
+ this->AddMode(new ModeUserOperator(Instance), 'o');
+ this->AddMode(new ModeUserServerNoticeMask(Instance), 'n');
+}
+
+bool ModeParser::InsertMode(std::string &output, const char* mode, unsigned short section)
+{
+ unsigned short currsection = 1;
+ unsigned int pos = output.find("CHANMODES=", 0) + 10; // +10 for the length of "CHANMODES="
+
+ if(section > 4 || section == 0)
+ {
+ log(DEBUG, "InsertMode: CHANMODES doesn't have a section %dh :/", section);
+ return false;
+ }