if (mode_on)
{
std::string ChanToJoin = params[0];
- chanrec* c = Srv->FindChannel(ChanToJoin);
+ chanrec *c;
+
+ if (!IsValidChannelName(ChanToJoin.c_str()))
+ {
+ WriteServ(user->fd,"403 %s %s :Invalid channel name",user->nick, ChanToJoin.c_str());
+ return 0;
+ }
+
+ c = Srv->FindChannel(ChanToJoin);
if (c)
{
/* Fix by brain: Dont let a channel be linked to *itself* either */
List[I_On005Numeric] = List[I_OnUserPreJoin] = List[I_OnExtendedMode] = 1;
}
- virtual void On005Numeric(std::string &output)
- {
- std::stringstream line(output);
- std::string temp1, temp2;
- while (!line.eof())
- {
- line >> temp1;
- if (temp1.substr(0,10) == "CHANMODES=")
- {
- // By doing this we're *assuming* no other module has fucked up the CHANMODES=
- // section of the 005 numeric. If they have, we're going DOWN in a blaze of glory,
- // with a honking great EXCEPTION :)
- temp1.insert(temp1.find(",")+1,"L");
- }
- temp2 = temp2 + temp1 + " ";
- }
- if (temp2.length())
- output = temp2.substr(0,temp2.length()-1);
- }
+ virtual void On005Numeric(std::string &output)
+ {
+ InsertMode(output, "L", 3);
+ }
virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
{