Anope IRC Services  Version 2.0
Public Member Functions | Private Attributes
ChanServCore Class Reference
Inheritance diagram for ChanServCore:
Inheritance graph
[legend]
Collaboration diagram for ChanServCore:
Collaboration graph
[legend]

Public Member Functions

 ChanServCore (const Anope::string &modname, const Anope::string &creator)
 
void Hold (Channel *c) anope_override
 
void OnReload (Configuration::Conf *conf) anope_override
 
void OnBotDelete (BotInfo *bi) anope_override
 
EventReturn OnBotPrivmsg (User *u, BotInfo *bi, Anope::string &message) anope_override
 
void OnDelCore (NickCore *nc) anope_override
 
void OnDelChan (ChannelInfo *ci) anope_override
 
EventReturn OnPreHelp (CommandSource &source, const std::vector< Anope::string > &params) anope_override
 
void OnPostHelp (CommandSource &source, const std::vector< Anope::string > &params) anope_override
 
void OnCheckModes (Reference< Channel > &c) anope_override
 
void OnCreateChan (ChannelInfo *ci) anope_override
 
EventReturn OnCanSet (User *u, const ChannelMode *cm) anope_override
 
void OnChannelSync (Channel *c) anope_override
 
void OnLog (Log *l) anope_override
 
void OnExpireTick () anope_override
 
EventReturn OnCheckDelete (Channel *c) anope_override
 
void OnPreUplinkSync (Server *serv) anope_override
 
void OnChanRegistered (ChannelInfo *ci) anope_override
 
void OnJoinChannel (User *u, Channel *c) anope_override
 
EventReturn OnChannelModeSet (Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string &param) anope_override
 
void OnChanInfo (CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) anope_override
 
void OnSetCorrectModes (User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) anope_override
 
- Public Member Functions inherited from Module
 Module (const Anope::string &modname, const Anope::string &loadernick, ModType type=THIRD)
 
virtual ~Module ()
 
void SetPermanent (bool state)
 
bool GetPermanent () const
 
void SetVersion (const Anope::string &version)
 
void SetAuthor (const Anope::string &author)
 
ModuleVersion GetVersion () const
 
virtual void OnPreUserKicked (const MessageSource &source, ChanUserContainer *cu, const Anope::string &kickmsg)
 
virtual void OnUserKicked (const MessageSource &source, User *target, const Anope::string &channel, ChannelStatus &status, const Anope::string &kickmsg)
 
virtual EventReturn OnPreBotAssign (User *sender, ChannelInfo *ci, BotInfo *bi)
 
virtual void OnBotAssign (User *sender, ChannelInfo *ci, BotInfo *bi)
 
virtual EventReturn OnBotUnAssign (User *sender, ChannelInfo *ci)
 
virtual void OnUserConnect (User *u, bool &exempt)
 
virtual void OnNewServer (Server *s)
 
virtual void OnUserNickChange (User *u, const Anope::string &oldnick)
 
virtual EventReturn OnPreCommand (CommandSource &source, Command *command, std::vector< Anope::string > &params)
 
virtual void OnPostCommand (CommandSource &source, Command *command, const std::vector< Anope::string > &params)
 
virtual void OnSaveDatabase ()
 
virtual EventReturn OnLoadDatabase ()
 
virtual EventReturn OnEncrypt (const Anope::string &src, Anope::string &dest)
 
virtual EventReturn OnDecrypt (const Anope::string &hashm, const Anope::string &src, Anope::string &dest)
 
virtual EventReturn OnBotFantasy (CommandSource &source, Command *c, ChannelInfo *ci, const std::vector< Anope::string > &params)
 
virtual EventReturn OnBotNoFantasyAccess (CommandSource &source, Command *c, ChannelInfo *ci, const std::vector< Anope::string > &params)
 
virtual void OnBotBan (User *u, ChannelInfo *ci, const Anope::string &mask)
 
virtual void OnBadWordAdd (ChannelInfo *ci, const BadWord *bw)
 
virtual void OnBadWordDel (ChannelInfo *ci, const BadWord *bw)
 
virtual void OnCreateBot (BotInfo *bi)
 
virtual void OnDelBot (BotInfo *bi)
 
virtual EventReturn OnBotKick (BotInfo *bi, Channel *c, User *u, const Anope::string &reason)
 
virtual void OnPrePartChannel (User *u, Channel *c)
 
virtual void OnPartChannel (User *u, Channel *c, const Anope::string &channel, const Anope::string &msg)
 
virtual void OnLeaveChannel (User *u, Channel *c)
 
virtual void OnTopicUpdated (Channel *c, const Anope::string &user, const Anope::string &topic)
 
virtual void OnPreChanExpire (ChannelInfo *ci, bool &expire)
 
virtual void OnChanExpire (ChannelInfo *ci)
 
virtual void OnPreServerConnect ()
 
virtual void OnServerConnect ()
 
virtual void OnServerDisconnect ()
 
virtual void OnRestart ()
 
virtual void OnShutdown ()
 
virtual void OnPreNickExpire (NickAlias *na, bool &expire)
 
virtual void OnNickExpire (NickAlias *na)
 
virtual void OnDefconLevel (int level)
 
virtual EventReturn OnExceptionAdd (Exception *ex)
 
virtual void OnExceptionDel (CommandSource &source, Exception *ex)
 
virtual EventReturn OnAddXLine (CommandSource &source, const XLine *x, XLineManager *xlm)
 
virtual void OnDelXLine (CommandSource &source, const XLine *x, XLineManager *xlm)
 
virtual EventReturn IsServicesOper (User *u)
 
virtual void OnServerQuit (Server *server)
 
virtual void OnUserQuit (User *u, const Anope::string &msg)
 
virtual void OnPreUserLogoff (User *u)
 
virtual void OnPostUserLogoff (User *u)
 
virtual void OnBotCreate (BotInfo *bi)
 
virtual void OnBotChange (BotInfo *bi)
 
virtual void OnAccessDel (ChannelInfo *ci, CommandSource &source, ChanAccess *access)
 
virtual void OnAccessAdd (ChannelInfo *ci, CommandSource &source, ChanAccess *access)
 
virtual void OnAccessClear (ChannelInfo *ci, CommandSource &source)
 
virtual void OnLevelChange (CommandSource &source, ChannelInfo *ci, const Anope::string &priv, int16_t what)
 
virtual EventReturn OnChanDrop (CommandSource &source, ChannelInfo *ci)
 
virtual void OnChanSuspend (ChannelInfo *ci)
 
virtual void OnChanUnsuspend (ChannelInfo *ci)
 
virtual void OnChannelCreate (Channel *c)
 
virtual void OnChannelDelete (Channel *c)
 
virtual void OnAkickAdd (CommandSource &source, ChannelInfo *ci, const AutoKick *ak)
 
virtual void OnAkickDel (CommandSource &source, ChannelInfo *ci, const AutoKick *ak)
 
virtual EventReturn OnCheckKick (User *u, Channel *c, Anope::string &mask, Anope::string &reason)
 
virtual EventReturn OnCheckPriv (const ChanAccess *access, const Anope::string &priv)
 
virtual EventReturn OnGroupCheckPriv (const AccessGroup *group, const Anope::string &priv)
 
virtual void OnNickDrop (CommandSource &source, NickAlias *na)
 
virtual void OnNickGroup (User *u, NickAlias *target)
 
virtual void OnNickIdentify (User *u)
 
virtual void OnUserLogin (User *u)
 
virtual void OnNickLogout (User *u)
 
virtual void OnNickRegister (User *user, NickAlias *na, const Anope::string &pass)
 
virtual void OnNickSuspend (NickAlias *na)
 
virtual void OnNickUnsuspended (NickAlias *na)
 
virtual void OnDelNick (NickAlias *na)
 
virtual void OnNickCoreCreate (NickCore *nc)
 
virtual void OnChangeCoreDisplay (NickCore *nc, const Anope::string &newdisplay)
 
virtual void OnNickClearAccess (NickCore *nc)
 
virtual void OnNickAddAccess (NickCore *nc, const Anope::string &entry)
 
virtual void OnNickEraseAccess (NickCore *nc, const Anope::string &entry)
 
virtual void OnNickClearCert (NickCore *nc)
 
virtual void OnNickAddCert (NickCore *nc, const Anope::string &entry)
 
virtual void OnNickEraseCert (NickCore *nc, const Anope::string &entry)
 
virtual void OnNickInfo (CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden)
 
virtual void OnBotInfo (CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info)
 
virtual void OnCheckAuthentication (User *u, IdentifyRequest *req)
 
virtual void OnNickUpdate (User *u)
 
virtual void OnFingerprint (User *u)
 
virtual void OnUserAway (User *u, const Anope::string &message)
 
virtual void OnInvite (User *source, Channel *c, User *targ)
 
virtual void OnDeleteVhost (NickAlias *na)
 
virtual void OnSetVhost (NickAlias *na)
 
virtual void OnSetDisplayedHost (User *)
 
virtual void OnMemoSend (const Anope::string &source, const Anope::string &target, MemoInfo *mi, Memo *m)
 
virtual void OnMemoDel (const Anope::string &target, MemoInfo *mi, const Memo *m)
 
virtual EventReturn OnChannelModeUnset (Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string &param)
 
virtual void OnUserModeSet (const MessageSource &setter, User *u, const Anope::string &mname)
 
virtual void OnUserModeUnset (const MessageSource &setter, User *u, const Anope::string &mname)
 
virtual void OnChannelModeAdd (ChannelMode *cm)
 
virtual void OnUserModeAdd (UserMode *um)
 
virtual EventReturn OnMLock (ChannelInfo *ci, ModeLock *lock)
 
virtual EventReturn OnUnMLock (ChannelInfo *ci, ModeLock *lock)
 
virtual void OnModuleLoad (User *u, Module *m)
 
virtual void OnModuleUnload (User *u, Module *m)
 
virtual void OnServerSync (Server *s)
 
virtual void OnUplinkSync (Server *s)
 
virtual void OnBotNotice (User *u, BotInfo *bi, Anope::string &message)
 
virtual void OnPrivmsg (User *u, Channel *c, Anope::string &msg)
 
virtual void OnLogMessage (LogInfo *li, const Log *l, const Anope::string &msg)
 
virtual void OnDnsRequest (DNS::Query &req, DNS::Query *reply)
 
virtual void OnSerializeCheck (Serialize::Type *)
 
virtual void OnSerializableConstruct (Serializable *)
 
virtual void OnSerializableDestruct (Serializable *)
 
virtual void OnSerializableUpdate (Serializable *)
 
virtual void OnSerializeTypeCreate (Serialize::Type *)
 
virtual EventReturn OnSetChannelOption (CommandSource &source, Command *cmd, ChannelInfo *ci, const Anope::string &setting)
 
virtual EventReturn OnSetNickOption (CommandSource &source, Command *cmd, NickCore *nc, const Anope::string &setting)
 
virtual EventReturn OnMessage (MessageSource &source, Anope::string &command, std::vector< Anope::string > &param)
 
virtual EventReturn OnNickValidate (User *u, NickAlias *na)
 
- Public Member Functions inherited from Extensible
virtual ~Extensible ()
 
template<typename T >
T * GetExt (const Anope::string &name) const
 
bool HasExt (const Anope::string &name) const
 
template<typename T >
T * Extend (const Anope::string &name, const T &what)
 
template<typename T >
T * Extend (const Anope::string &name)
 
template<typename T >
T * Require (const Anope::string &name)
 
template<typename T >
void Shrink (const Anope::string &name)
 
template<>
bool * Extend (const Anope::string &name, const bool &what)
 
- Public Member Functions inherited from ChanServService
 ChanServService (Module *m)
 
- Public Member Functions inherited from Service
 Service (Module *o, const Anope::string &t, const Anope::string &n)
 
virtual ~Service ()
 
void Register ()
 
void Unregister ()
 
- Public Member Functions inherited from Base
 Base ()
 
virtual ~Base ()
 
void AddReference (ReferenceBase *r)
 
void DelReference (ReferenceBase *r)
 

Private Attributes

Reference< BotInfoChanServ
 
std::vector< Anope::stringdefaults
 
ExtensibleItem< bool > inhabit
 
ExtensibleRef< bool > persist
 
bool always_lower
 

Additional Inherited Members

- Static Public Member Functions inherited from Extensible
static void ExtensibleSerialize (const Extensible *, const Serializable *, Serialize::Data &data)
 
static void ExtensibleUnserialize (Extensible *, Serializable *, Serialize::Data &data)
 
- Static Public Member Functions inherited from Service
static ServiceFindService (const Anope::string &t, const Anope::string &n)
 
static std::vector< Anope::stringGetServiceKeys (const Anope::string &t)
 
static void AddAlias (const Anope::string &t, const Anope::string &n, const Anope::string &v)
 
static void DelAlias (const Anope::string &t, const Anope::string &n)
 
- Data Fields inherited from Module
Anope::string name
 
ModType type
 
Anope::string filename
 
void * handle
 
time_t created
 
Anope::string version
 
Anope::string author
 
- Data Fields inherited from Extensible
std::set< ExtensibleBase * > extension_items
 
- Data Fields inherited from Service
Moduleowner
 
Anope::string type
 
Anope::string name
 

Detailed Description

Definition at line 15 of file chanserv.cpp.

Constructor & Destructor Documentation

ChanServCore::ChanServCore ( const Anope::string modname,
const Anope::string creator 
)
inline

Definition at line 24 of file chanserv.cpp.

Member Function Documentation

void ChanServCore::Hold ( Channel c)
inlinevirtual

A timer used to keep the BotServ bot/ChanServ in the channel after kicking the last user in a channel

Constructor

Parameters
chanThe channel

Called when the delay is up

Parameters
Thecurrent time

Implements ChanServService.

Definition at line 29 of file chanserv.cpp.

References anope_override, ChanServ, Channel::ci, Channel::FindUser(), BaseExtensibleItem< T >::HasExt(), inhabit, BotInfo::Join(), Service::owner, BotInfo::Part(), Channel::RemoveMode(), BaseExtensibleItem< T >::Set(), Channel::SetMode(), BaseExtensibleItem< T >::Unset(), and Channel::users.

Referenced by OnChannelSync().

void ChanServCore::OnBotDelete ( BotInfo bi)
inlinevirtual

Called when a bot is deleted

Parameters
biThe bot

Reimplemented from Module.

Definition at line 119 of file chanserv.cpp.

EventReturn ChanServCore::OnBotPrivmsg ( User u,
BotInfo bi,
Anope::string message 
)
inlinevirtual

Called when we receive a PRIVMSG for one of our clients

Parameters
uThe user sending the PRIVMSG
biThe target of the PRIVMSG
messageThe message
Returns
EVENT_STOP to halt processing

Reimplemented from Module.

Definition at line 125 of file chanserv.cpp.

References ACCESS_DENIED, EVENT_CONTINUE, and EVENT_STOP.

EventReturn ChanServCore::OnCanSet ( User u,
const ChannelMode cm 
)
inlinevirtual

Called to determine if a chnanel mode can be set by a user

Parameters
uThe user
cmThe mode

Reimplemented from Module.

Definition at line 303 of file chanserv.cpp.

References EVENT_CONTINUE, EVENT_STOP, and Anope::string::npos.

void ChanServCore::OnChanInfo ( CommandSource source,
ChannelInfo ci,
InfoFormatter info,
bool  show_hidden 
)
inlinevirtual

Called when a user requests info for a channel

Parameters
sourceThe user requesting info
ciThe channel the user is requesting info for
infoData to show the user requesting information
show_hiddentrue if we should show the user everything

Reimplemented from Module.

Definition at line 453 of file chanserv.cpp.

References _, Anope::CurTime, Anope::NoExpire, and Anope::strftime().

EventReturn ChanServCore::OnChannelModeSet ( Channel c,
MessageSource setter,
ChannelMode mode,
const Anope::string param 
)
inlinevirtual

Called when a mode is set on a channel

Parameters
cThe channel
setterThe user or server that is setting the mode
modeThe mode
paramThe mode param, if there is one
Returns
EVENT_STOP to make mlock/secureops etc checks not happen

Reimplemented from Module.

Definition at line 434 of file chanserv.cpp.

References Anope::CurTime, EVENT_CONTINUE, ModeManager::FindChannelModeByName(), ChannelStatus::HasMode(), Mode::mchar, and ChanUserContainer::status.

void ChanServCore::OnChannelSync ( Channel c)
inlinevirtual

Called when a channel is synced. Channels are synced after a sjoin is finished processing for a newly created channel to set the correct modes, topic, set.

Reimplemented from Module.

Definition at line 311 of file chanserv.cpp.

References Hold(), and Me.

void ChanServCore::OnChanRegistered ( ChannelInfo ci)
inlinevirtual

Called when a channel is registered

Parameters
ciThe channel

Reimplemented from Module.

Definition at line 411 of file chanserv.cpp.

EventReturn ChanServCore::OnCheckDelete ( Channel c)
inlinevirtual

Reimplemented from Module.

Definition at line 364 of file chanserv.cpp.

References EVENT_CONTINUE, EVENT_STOP, and BaseExtensibleItem< T >::HasExt().

void ChanServCore::OnCheckModes ( Reference< Channel > &  c)
inlinevirtual

Called when a channels modes are being checked to see if they are allowed, mostly to ensure mlock/+r are set.

Parameters
cThe channel

Reimplemented from Module.

Definition at line 276 of file chanserv.cpp.

References Anope::string::c_str(), and Anope::string::empty().

void ChanServCore::OnCreateChan ( ChannelInfo ci)
inlinevirtual

Called when a channel is being created, for any reason

Parameters
ciThe channel

Reimplemented from Module.

Definition at line 296 of file chanserv.cpp.

void ChanServCore::OnDelChan ( ChannelInfo ci)
inlinevirtual

Called when a channel is being deleted, for any reason

Parameters
ciThe channel

Reimplemented from Module.

Definition at line 209 of file chanserv.cpp.

References Anope::string::c_str(), Anope::string::empty(), Anope::string::equals_ci(), ChannelInfo::Find(), ChannelInfo::GetAccess(), ChannelInfo::GetAccessCount(), and ChanAccess::Mask().

void ChanServCore::OnDelCore ( NickCore nc)
inlinevirtual
void ChanServCore::OnExpireTick ( )
inlinevirtual
void ChanServCore::OnJoinChannel ( User u,
Channel c 
)
inlinevirtual

Called after a user joins a channel If this event triggers the user is allowed to be in the channel, and will not be kicked for restricted/akick/forbidden, etc. If you want to kick the user, use the CheckKick event instead.

Parameters
uThe user
channelThe channel

Reimplemented from Module.

Definition at line 423 of file chanserv.cpp.

References Log::ci, IRCD, LOG_DEBUG, IRCDProto::SendChannel(), and ChannelInfo::time_registered.

void ChanServCore::OnLog ( Log l)
inlinevirtual

Called when a message is logged

Parameters
lThe log message

Reimplemented from Module.

Definition at line 320 of file chanserv.cpp.

References ChanServ, and LOG_CHANNEL.

void ChanServCore::OnPostHelp ( CommandSource source,
const std::vector< Anope::string > &  params 
)
inlinevirtual

Called when someone uses the generic/help command

Parameters
sourceCommand source
paramsParams

Reimplemented from Module.

Definition at line 259 of file chanserv.cpp.

References _, and ChanServ.

EventReturn ChanServCore::OnPreHelp ( CommandSource source,
const std::vector< Anope::string > &  params 
)
inlinevirtual

Called when someone uses the generic/help command

Parameters
sourceCommand source
paramsParams
Returns
EVENT_STOP to stop processing

Reimplemented from Module.

Definition at line 244 of file chanserv.cpp.

References _, Anope::string::c_str(), ChanServ, EVENT_CONTINUE, and User::nick.

void ChanServCore::OnPreUplinkSync ( Server serv)
inlinevirtual
void ChanServCore::OnReload ( Configuration::Conf conf)
inlinevirtual

Called when Services' configuration is being (re)loaded.

Parameters
confThe config that is being built now and will replace the global Config object
Exceptions
AConfigException to abort the config (re)loading process.

Reimplemented from Module.

Definition at line 92 of file chanserv.cpp.

References Anope::string::empty(), BotInfo::Find(), sepstream::GetTokens(), and Module::name.

void ChanServCore::OnSetCorrectModes ( User user,
Channel chan,
AccessGroup access,
bool &  give_modes,
bool &  take_modes 
)
inlinevirtual

Called to set the correct modes on the user on the given channel

Parameters
userThe user
chanThe channel
accessThe user's access on the channel
give_modesIf giving modes is desired
take_modesIf taking modes is desired

Reimplemented from Module.

Definition at line 463 of file chanserv.cpp.

References ModeManager::FindChannelModeByName().

Field Documentation

bool ChanServCore::always_lower
private

Definition at line 21 of file chanserv.cpp.

Reference<BotInfo> ChanServCore::ChanServ
private

Definition at line 17 of file chanserv.cpp.

Referenced by Hold(), OnLog(), OnPostHelp(), and OnPreHelp().

std::vector<Anope::string> ChanServCore::defaults
private

Definition at line 18 of file chanserv.cpp.

ExtensibleItem<bool> ChanServCore::inhabit
private

Definition at line 19 of file chanserv.cpp.

Referenced by Hold().

ExtensibleRef<bool> ChanServCore::persist
private

Definition at line 20 of file chanserv.cpp.


The documentation for this class was generated from the following file: