- ModuleDeaf(InspIRCd* Me)
- : Module(Me)
- {
- m1 = new User_d(ServerInstance);
- if (!ServerInstance->AddMode(m1))
- throw ModuleException("Could not add new modes!");
-
- OnRehash(NULL, "");
- Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_OnRehash, I_OnBuildExemptList };
- ServerInstance->Modules->Attach(eventlist, this, 4);
- }
-
- void Implements(char* List)
- {
- List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = List[I_OnRehash] = List[I_OnBuildExemptList] = 1;
- }
-
- virtual void OnRehash(User* user, const std::string&)
- {
- ConfigReader* conf = new ConfigReader(ServerInstance);
- deaf_bypasschars = conf->ReadValue("deaf", "bypasschars", 0);
- deaf_bypasschars_uline = conf->ReadValue("deaf", "bypasscharsuline", 0);
-
- delete conf;
- }
-
- virtual int OnUserPreNotice(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
- {
- if (target_type == TYPE_CHANNEL)
- {
- Channel* chan = (Channel*)dest;
- if (chan)
- this->BuildDeafList(MSG_NOTICE, chan, user, status, text, exempt_list);
- }
-
- return 0;
- }
-
- virtual int OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)