- 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 int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
+class ModuleRedirect : public Module
+{
+
+ Redirect re;
+
+ public:
+
+ ModuleRedirect()
+ : re(this)
+ {
+
+ if (!ServerInstance->Modes->AddMode(&re))
+ throw ModuleException("Could not add new modes!");
+ Implementation eventlist[] = { I_OnUserPreJoin };
+ ServerInstance->Modules->Attach(eventlist, this, 1);
+ }
+
+
+ virtual ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)