1
0
mirror of https://github.com/anope/anope.git synced 2026-06-14 10:14:47 +02:00
Files
anope/modules/helpchan.cpp
T
Sadie Powell 010beb52b1 Store the setter and ts for all modes and try to restore them.
This is mostly for preserving channel list mode info.
2025-05-03 21:28:56 +01:00

34 lines
764 B
C++

/*
*
* (C) 2003-2025 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
#include "module.h"
class HelpChannel final
: public Module
{
public:
HelpChannel(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR)
{
}
EventReturn OnChannelModeSet(Channel *c, MessageSource &, ChannelMode *mode, const ModeData &data) override
{
if (mode->name == "OP" && c && c->ci && c->name.equals_ci(Config->GetModule(this).Get<const Anope::string>("helpchannel")))
{
User *u = User::Find(data.value);
if (u && c->ci->AccessFor(u).HasPriv("OPME"))
u->SetMode(Config->GetClient("OperServ"), "HELPOP");
}
return EVENT_CONTINUE;
}
};
MODULE_INIT(HelpChannel)