- InsertMode(output,"C",4);
- }
-
- virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status)
- {
- return OnUserPreNotice(user,dest,target_type,text,status);
- }
-
- virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status)
- {
- if (target_type == TYPE_CHANNEL)
- {
- chanrec* c = (chanrec*)dest;
- if (c->IsModeSet('C'))
- {
- if ((text.length()) && (text[0] == '\1'))
- {
- if (strncmp(text.c_str(),"\1ACTION ",8))
- {
- WriteServ(user->fd,"492 %s %s :Can't send CTCP to channel (+C set)",user->nick, c->name);
- return 1;
- }
- }
- }
- }
- return 0;
- }
-
- virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms)
- {
- // check if this is our mode character...
- if ((modechar == 'C') && (type == MT_CHANNEL))
- {
- log(DEBUG,"Allowing C change");
- return 1;
- }
- else
- {
- return 0;
- }
+ ServerInstance->Modules->AddService(nc);
+ Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_On005Numeric };
+ ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));