Anope IRC Services  Version 2.0
m_helpchan.cpp
Go to the documentation of this file.
1 /*
2  * (C) 2003-2014 Anope Team
3  * Contact us at team@anope.org
4  *
5  * Please read COPYING and README for further details.
6  */
7 
8 #include "module.h"
9 
10 class HelpChannel : public Module
11 {
12  public:
13  HelpChannel(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR)
14  {
15  }
16 
18  {
19  if (mode->name == "OP" && c && c->ci && c->name.equals_ci(Config->GetModule(this)->Get<const Anope::string>("helpchannel")))
20  {
21  User *u = User::Find(param);
22 
23  if (u && c->ci->AccessFor(u).HasPriv("OPME"))
24  u->SetMode(Config->GetClient("OperServ"), "HELPOP");
25  }
26 
27  return EVENT_CONTINUE;
28  }
29 };
30 
void SetMode(BotInfo *bi, UserMode *um, const Anope::string &param="")
Definition: users.cpp:573
Definition: users.h:34
Definition: Config.cs:26
HelpChannel(const Anope::string &modname, const Anope::string &creator)
Definition: m_helpchan.cpp:13
bool HasPriv(const Anope::string &privstr)
Definition: users.cpp:487
EventReturn OnChannelModeSet(Channel *c, MessageSource &, ChannelMode *mode, const Anope::string &param) anope_override
Definition: m_helpchan.cpp:17
#define anope_override
Definition: services.h:56
EventReturn
Definition: modules.h:129
#define MODULE_INIT(x)
Definition: modules.h:45
static User * Find(const Anope::string &name, bool nick_only=false)
Definition: users.cpp:815