The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ModuleDelayJoin Class Reference

Inheritance diagram for ModuleDelayJoin:

Inheritance graph
[legend]
Collaboration diagram for ModuleDelayJoin:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleDelayJoin (InspIRCd *Me)
virtual ~ModuleDelayJoin ()
virtual Version GetVersion ()
 Returns the version number of a Module.
virtual void OnNamesListItem (User *issuer, User *user, Channel *channel, std::string &prefixes, std::string &nick)
 Called for every item in a NAMES list, so that modules may reformat portions of it as they see fit.
virtual void OnUserJoin (User *user, Channel *channel, bool sync, bool &silent)
 Called when a user joins a channel.
bool OnHostCycle (User *user)
 Called for every time the user's host or ident changes, to indicate wether or not the 'Changing host' message should be sent, if enabled.
void OnUserPart (User *user, Channel *channel, std::string &partmessage, bool &silent)
 Called when a user parts a channel.
void OnUserKick (User *source, User *user, Channel *chan, const std::string &reason, bool &silent)
 Called whenever a user is kicked.
void OnUserQuit (User *user, const std::string &reason, const std::string &oper_message)
 Called when a user quits.
void OnText (User *user, void *dest, int target_type, const std::string &text, char status, CUList &exempt_list)
 Called immediately before any NOTICE or PRIVMSG sent from a user, local or remote.
void WriteCommonFrom (User *user, Channel *channel, const char *text,...) CUSTOM_PRINTF(4

Private Attributes

DelayJoinModedjm
CUList nl

Detailed Description

Definition at line 28 of file m_delayjoin.cpp.


Constructor & Destructor Documentation

ModuleDelayJoin::ModuleDelayJoin InspIRCd Me  )  [inline]
 

Definition at line 34 of file m_delayjoin.cpp.

References ModeParser::AddMode(), ModuleManager::Attach(), djm, I_OnHostCycle, I_OnNamesListItem, I_OnText, I_OnUserJoin, I_OnUserKick, I_OnUserPart, I_OnUserQuit, InspIRCd::Modes, InspIRCd::Modules, and Module::ServerInstance.

ModuleDelayJoin::~ModuleDelayJoin  )  [virtual]
 

Definition at line 87 of file m_delayjoin.cpp.

References ModeParser::DelMode(), djm, InspIRCd::Modes, and Module::ServerInstance.


Member Function Documentation

Version ModuleDelayJoin::GetVersion  )  [virtual]
 

Returns the version number of a Module.

The method should return a Version object with its version information assigned via Version::Version

Reimplemented from Module.

Definition at line 93 of file m_delayjoin.cpp.

References API_VERSION, VF_COMMON, and VF_VENDOR.

bool ModuleDelayJoin::OnHostCycle User user  )  [virtual]
 

Called for every time the user's host or ident changes, to indicate wether or not the 'Changing host' message should be sent, if enabled.

Certain modules such as auditorium may opt to hide this message even if it is enabled.

Reimplemented from Module.

Definition at line 159 of file m_delayjoin.cpp.

References Extensible::GetExt().

void ModuleDelayJoin::OnNamesListItem User issuer,
User user,
Channel channel,
std::string prefixes,
std::string nick
[virtual]
 

Called for every item in a NAMES list, so that modules may reformat portions of it as they see fit.

For example NAMESX, channel mode +u and +I, and UHNAMES. If the nick is set to an empty string by any module, then this will cause the nickname not to be displayed at all.

Reimplemented from Module.

Definition at line 98 of file m_delayjoin.cpp.

References Extensible::GetExt(), Channel::IsModeSet(), and Channel::name.

void ModuleDelayJoin::OnText User user,
void *  dest,
int  target_type,
const std::string text,
char  status,
CUList exempt_list
[virtual]
 

Called immediately before any NOTICE or PRIVMSG sent from a user, local or remote.

The dest variable contains a User* if target_type is TYPE_USER and a Channel* if target_type is TYPE_CHANNEL. The difference between this event and OnUserPreNotice/OnUserPreMessage is that delivery is gauranteed, the message has already been vetted. In the case of the other two methods, a later module may stop your message. This also differs from OnUserMessage which occurs AFTER the message has been sent.

Parameters:
user The user sending the message
dest The target of the message
target_type The type of target (TYPE_USER or TYPE_CHANNEL)
text the text being sent by the user
status The status being used, e.g. NOTICE #chan has status== '@', 0 to send to everyone.

Reimplemented from Module.

Definition at line 179 of file m_delayjoin.cpp.

References User::chans, Extensible::GetExt(), InspIRCd::Modes, ModeParser::ModeString(), Channel::name, Module::ServerInstance, Extensible::Shrink(), TYPE_CHANNEL, and WriteCommonFrom().

void ModuleDelayJoin::OnUserJoin User user,
Channel channel,
bool  sync,
bool &  silent
[virtual]
 

Called when a user joins a channel.

The details of the joining user are available to you in the parameter User *user, and the details of the channel they have joined is available in the variable Channel *channel

Parameters:
user The user who is joining
channel The channel being joined
silent Change this to true if you want to conceal the JOIN command from the other users of the channel (useful for modules such as auditorium)
sync This is set to true if the JOIN is the result of a network sync and the remote user is being introduced to a channel due to the network sync.

Reimplemented from Module.

Definition at line 114 of file m_delayjoin.cpp.

References Extensible::Extend(), Extensible::GetExt(), Channel::IsModeSet(), Channel::name, and User::WriteFrom().

void ModuleDelayJoin::OnUserKick User source,
User user,
Channel chan,
const std::string reason,
bool &  silent
[virtual]
 

Called whenever a user is kicked.

If this method is called, the kick is already underway and cannot be prevented, so to prevent a kick, please use Module::OnUserPreKick instead of this method.

Parameters:
source The user issuing the kick
user The user being kicked
chan The channel the user is being kicked from
reason The kick reason
silent Change this to true if you want to conceal the PART command from the other users of the channel (useful for modules such as auditorium)

Reimplemented from Module.

Definition at line 146 of file m_delayjoin.cpp.

References Extensible::GetExt(), Channel::IsModeSet(), Channel::name, User::nick, and User::WriteFrom().

void ModuleDelayJoin::OnUserPart User user,
Channel channel,
std::string partmessage,
bool &  silent
[virtual]
 

Called when a user parts a channel.

The details of the leaving user are available to you in the parameter User *user, and the details of the channel they have left is available in the variable Channel *channel

Parameters:
user The user who is parting
channel The channel being parted
partmessage The part message, or an empty string (may be modified)
silent Change this to true if you want to conceal the PART command from the other users of the channel (useful for modules such as auditorium)

Reimplemented from Module.

Definition at line 133 of file m_delayjoin.cpp.

References Extensible::GetExt(), Channel::IsModeSet(), Channel::name, and User::WriteFrom().

void ModuleDelayJoin::OnUserQuit User user,
const std::string reason,
const std::string oper_message
[virtual]
 

Called when a user quits.

The details of the exiting user are available to you in the parameter User *user This event is only called when the user is fully registered when they quit. To catch raw disconnections, use the OnUserDisconnect method.

Parameters:
user The user who is quitting
message The user's quit message (as seen by non-opers)
oper_message The user's quit message (as seen by opers)

Reimplemented from Module.

Definition at line 164 of file m_delayjoin.cpp.

References User::chans, Extensible::GetExt(), CommandParser::GetHandler(), Command::Handle(), InspIRCd::Parser, and Module::ServerInstance.

void ModuleDelayJoin::WriteCommonFrom User user,
Channel channel,
const char *  text,
  ...
 

Definition at line 214 of file m_delayjoin.cpp.

References User::GetFullHost(), Channel::GetUsers(), MAXBUF, User::Visibility, and VisData::VisibleTo().

Referenced by OnText().


Member Data Documentation

DelayJoinMode* ModuleDelayJoin::djm [private]
 

Definition at line 31 of file m_delayjoin.cpp.

Referenced by ModuleDelayJoin(), and ~ModuleDelayJoin().

CUList ModuleDelayJoin::nl [private]
 

Definition at line 32 of file m_delayjoin.cpp.


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