1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 /* $ModDesc: Provides support for unreal-style channel mode +T */
18 class NoNotice : public SimpleChannelModeHandler
21 NoNotice(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'T') { }
24 class ModuleNoNotice : public Module
30 ModuleNoNotice(InspIRCd* Me)
34 nt = new NoNotice(ServerInstance);
35 if (!ServerInstance->Modes->AddMode(nt))
36 throw ModuleException("Could not add new modes!");
37 Implementation eventlist[] = { I_OnUserPreNotice };
38 ServerInstance->Modules->Attach(eventlist, this, 1);
42 virtual int OnUserPreNotice(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
44 if ((target_type == TYPE_CHANNEL) && (IS_LOCAL(user)))
46 Channel* c = (Channel*)dest;
47 if (c->IsModeSet('T'))
49 if (ServerInstance->ULine(user->server))
54 else if (CHANOPS_EXEMPT(ServerInstance, 'T') && c->GetStatus(user) == STATUS_OP)
56 // channel ops are exempt if set in conf.
61 user->WriteNumeric(404, "%s %s :Can't send NOTICE to channel (+T set)",user->nick, c->name);
69 virtual ~ModuleNoNotice()
71 ServerInstance->Modes->DelMode(nt);
75 virtual Version GetVersion()
77 return Version(1,2,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
81 MODULE_INIT(ModuleNoNotice)